I use Perl 5.10 from ActivePerl on Win7 with Tkx bindings.

I would like to graph time series data in input format "DD-MM-YYYY HH:MM:SS". The original data contained a TZ adjustment which I can convert to GMT following http://www.perlmonks.org/?node_id=1012596. The time series data shall be binned as per user input values of the upper and lower data bounds, and the number of bins, to define the bin width. The value of a bin shall be the number of timestamps falling within the bin: a simple integer value. I can use Math::SimpleHisto::XS to actually bin my data, but am not sure what format the array returned by the all_bin_contents() method is in.

My challenge is in drawing the data as a vertical bar chart. GD::Graph::histogram does this, but I don't think it can handle time series data. Chart::Clicker https://metacpan.org/module/Chart::Clicker is of course very nice, but I think the number of dependencies will kill my project. I do not have access to Gnu Plot, or similar.

At the moment I use a simple Perl script to covert my timestamps, then inport to MS Excel as a CSV and use the Data Analysis add on http://support.microsoft.com/kb/214269. This is fine for occasional use, but I'd like to write something to reduce the number of steps needed to arrive at usable output.

For chart labels, I am happy to plot the y-axis as an integer, and the x-axis as the time part of the date time stamp i.e. HH:MM:SS.

How can this target be achieved in Perl, without pulling in too many dependencies? I don't actually need to plot the graph, if I can write the graph to an output file in some portable format like PNG, GIF or PDF. I can then use methods included in the Tkx bindings to display the results.

Wisdom gratefully accepted!!


In reply to Bar chart of binned timestamp data by v4169sgr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.