When I've done similar things, as the whole thing was HTML, rather than generating the bars on the fly, I just had a few bars of each color, and then placed them on the page, giving them a specific width, and an appropriate alt tag (so you'd get a text graph if you looked in lynx ... this was quite some time ago).

Working this way, you just have to iterate through the events, with the following:

printf( '<img src='img/empty.gif' width='%i' height='10' alt='%s'><a h +ref='%s'><img src='img/%s.gif' width='%i' height='10' alt='%s'></a>', $delay_to_next_event / $image_scaling_factor, ' ' x ( $delay_to_next_event / $text_scaling_factor ), $url_to_event_details, $filename_possibly_based_on_event_type, $duration_of_event / $image_scaling_factor, '*' x ( $duration_of_event / $text_scaling_factor ), );

It's rather crude, but it works ... and it worked with what's now 10 year old technology.

Oh -- and generating imagemaps dynamically isn't too hard -- you just generate a client size image map -- loop through the events, and define a rectangle ... of course, you need to get their position relative to the edge, which takes a little bit of extra math, but no more difficult than keeping track of the time between events


In reply to Re: Web Timeline Graphics by jhourcle
in thread Web Timeline Graphics by queeg

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.