#!/usr/bin/perl -w use strict; use GD::Graph::bars3d; use GD::Graph::Data; use GD::Graph::colour qw{ add_colour colour_list }; my $username = 'crazyinsomniac'; my $month = 'April'; my $year = '2002'; my @days = ( [1..30], [qw{ 10 1 -1 22 33 1 6 7 4 8 9 34 112 -2 -12 33 22 33 1 6 7 22 33 1 6 7 66 -66 0 1 }], ); my $graph = new GD::Graph::bars3d( 600, 400 ); add_colour('#66CC66'); add_colour('#00fbff'); add_colour('#000000'); $graph->set( y_label => 'XP change', # xp is not Reputation, thanks grinder x_label => 'DAY OF MONTH', box_axis => 1, x_tick_number => undef, # accentclr => '#000000', # this be the bar box edges accentclr => '#009999', # this be the bar box edges # dclrs => [ map{'#66CC66'} 1..@days ], # data color dclrs => [ map{'#00fbff'} 1..@days ], # data color title => "${username}'s XP gains/losses per day for $month, $year" ) or die "$!"; my $days = GD::Graph::Data->new(); $days->copy_from(\@days); $graph->set(show_values => 1 ); ## show values $graph->set_values_font(GD::gdMediumBoldFont); my $gd = $graph->plot( $days ); $gd->interlaced('true'); open(FOUT,'>'.__FILE__.'.png') or die $!; binmode(FOUT); print FOUT $gd->png; close(FOUT)