#!/usr/bin/env perl use strict; use warnings; use GD::Graph; use GD::Graph::bars; my @data = ( [ 'Windows', 'Linux', 'Solaris' ], # Swap the next two lines to switch versions of the graph [ 150, 250, 350 ], [ 100, 200, 300 ], ); my $x_Label = "XLabel"; my $Graph_Title = "Graph Title"; my $graph = new GD::Graph::bars(900,600); $graph->set( x_label => $x_Label, x_label_position => 1/4, x_label_vertical => 1, y_label => 'Minutes', y_max_value => 300, y_tick_number => 10, title => $Graph_Title, bar_width => 35, cumulate => 1, dclrs => [ 'blue','cyan' ], bgclr => 'white', fgclr => 'lred', values_vertical => 0, valuesclr => 'black', accentclr => 'red', shadowclr => '#F7E7CE', shadow_depth => 0, legendclr => 'blue', show_values => 1 ); my $gd = $graph->plot(\@data) or die $graph->error; open my $IMG, '>', 'file2.png' or die $!; binmode $IMG; print $IMG $gd->png;