This module creates bar-format timelines using the GD.pm module. Timelines are automatically laid out so that their entries don't overlap each other. Depending on the version of GD you have, you can produce several different file formats, including GIF or PNG files.

These parameters affect the colors of the image. Each associated value should be a 3-element array reference, specifying RGB values from 0 to 255. For instance, the default value of bar_color is pure red, specified as [255,0,0]. The defaults are reasonable, but not necessarily attractive.

By default, the numerical data describing an entry's start and end point are also used as the label for the legend at the top of the timeline. Typically this means that the data represent years. However, if you supply the date_format parameter, the data will be assumed to be a Unix timestamp (similar to the output of the time() function), and it will be passed to the Date::Formattime2str function, using the date_format parameter as the formatting string.

The function used to convert the numerical data describing and entry's start and end point can be defined using this parameter. This function is only used if the date_format parameter is not defined and should take one argument, the numerical value.

Creates the GD object and returns it. This method is where all the real work is done - the code must figure out things like how to squeeze the entries most compactly but avoid collisions between bars, when to draw labels above their bars and when below (again, to avoid collisions between labels), the image's height (a function of how many concurrent entries it contains), and so on.

A convenience method which writes the timeline to a file. Because of some Unisys/Compuserve/GD patent issues that I don't want to get involved in, writing PNG output requires a version of GD newer than 1.19, while writing GIF output requires GD version 1.19 or older. See the GD.pm documentation for more information on this issue.

Writes the timeline in the specified format to the specified file. For example, $t->write('png', 'foo.png') writes a PNG file to foo.png. The format can be any format supported by your version of GD, which may include png, gif, jpeg, gd, gd2, and wbmp in recent versions of GD. Any extra arguments will be passed to the GD rendering method, which may be useful for methods like jpeg or wbmp.

Currently all dates/times are specified as integers, which are meant to represent years. Finer granularity (time of day) isn't supported yet, but it probably could be if it's desired (or someone gives me a patch).

Doesn't yet fully test the PNG capabilities during 'make test'. This is just because I haven't yet found time to build all the necessary PNG libraries on my system, so I haven't gotten the benchmark image built. Please let me know whether this works correctly, and maybe even send me the 't/testdata.png' file created so I can include it here.