I'd like to create a plot (just data points) where the x-values are dates like yyyy-mm-dd (no time needed, just day). The dates aren't consecutive, just various jumbled dates.

Looking at the docs for some of the various alternatives (GD::Graph, Chart::Gnuplot, Chart::Clicker, Chart), I don't see any mention of being able to automatically use dates (I want them to be treated like regular numerical values).

I suppose I could convert the dates to epoch times using DateTime, but then I'd have a plot showing epoch times in the x-axis instead of dates, but that would be difficult for readers to make sense of.

Should I used Datetime and fiddle with trying to convert date values and manually setting plot tick values, or can one of the plotting / charting modules do this for me?

Thanks!


In reply to Create a plot / chart with dates as x-values? by Anonymous Monk

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.