neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
Yes, this is done through Mason.<%perl> use GD::Graph::bars; use Data::Dumper; my ($x, $y, @numbers, $number); my @data = ( # X axis [ qw( -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 )] ); # loop for each success level for ($x = 1, $x < 5, $x++){ # generate numbers for each skill level for ($y = 1, $y < 19, $y++){ $number = $x*$y*2+5; push @numbers, $number; } push @data, [@numbers]; } my $graph = new GD::Graph::bars(); $graph->set( title => 'Skill Resolution', x_label => 'Skill Level', y_label => 'Success Level' ); my $gd = $graph->plot(\@data) or die "Could not plot: ".$graph->error. Dumper(@data); print "Content-type: image/png\n\n"; print $gd->png(); </%perl>
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GD::Graph without saving file
by PodMaster (Abbot) on Jul 07, 2004 at 23:33 UTC | |
by neilwatson (Priest) on Jul 07, 2004 at 23:54 UTC | |
by dws (Chancellor) on Jul 08, 2004 at 00:12 UTC | |
by neilwatson (Priest) on Jul 07, 2004 at 23:38 UTC | |
by PodMaster (Abbot) on Jul 07, 2004 at 23:45 UTC | |
|
Re: GD::Graph without saving file
by neilwatson (Priest) on Jul 12, 2004 at 13:36 UTC |