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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |