use GD; use GD::Graph::Data; use GD::Graph::bars; my $data = GD::Graph::Data->new( [["2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010"], [ 10.2, 7.5, 4.8, 5.5, 5.5, 5.3, 4.6, 5.3, 5.7, 3.6], [ 9.8, 8.4, 4.4, 5.2, 5.3, 5.2, 4.9, 6.1, 6.3, 3.8]]); my $graph = new GD::Graph::bars( 1200, 800 ); $graph->set( title => 'Test Graph', types => [qw(bars bars)], transparent => 0, bar_spacing => 0, bargroup_spacing => 20, show_values => 1, x_labels_vertical => 1, interlaced => 0, ); my $gd = $graph->plot( $data ); open (MYFILE, '>test.gif'); binmode MYFILE; print MYFILE $gd->gif(); close (MYFILE);