Graph::Timeline - Render timeline data

This document refers to verion 0.1 of Graph::Timeline, released November
11, 2003

This class takes a list of events and processes them so that they can
be rendered in various graphical formats by subclasses of this class.

The purpose of this class is to organise the data that will be used to
render a timeline. Events fall into two types. Intervals, which has a
start and an end. For example Albert Einstein was born on 1879/03/14
and died on 1955/04/18, this would be stored as an interval. His works
were publicly burned by the Nazi's on 1933/05/10 for being 'of un-German
spirit', I guess being Jewish didn't help either. So this event would be
marked as a point.

You feed events into the class using add_interval( ) and add_point( ),
then use window( ) to select which events you want to render and then
call data( ) to get the relevant events. This last bit will be done in
the subclass.



This document refers to verion 0.1 of Graph::Timeline::GD, released
November 11, 2003

This subclass produces the GD object of the timeline. The user has to
subclass from this class if they want a GD rendering of the timeline
data. By overriding the render_year( ) and render_interval( ) methods
the user can supply a less garish and more pleasing display.

use Graph::Timeline::GD;

my $x = Graph::Timeline::GD->new();

while ( my $line = <> ) {
chomp($line);
my ( $label, $start, $end, $group ) = split ( ',', $line );
$x->add_interval( label => $label, start => $start, end => $end,
group => $group );
}
$x->window(start=>'1900/01/01', end=>'1999/12/31');

open(FILE, '>test.png');
binmode(FILE);
print FILE $x->render( border => 2, pixelsperyear => 35 );
close(FILE);

Some sample data is also available.