raja2kind has asked for the wisdom of the Perl Monks concerning the following question:
use CGI ':standard'; use GD::Graph::bars; # Both the arrays should same number of entries. my @data = (["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], [23, 5, 2, 20, 11, 33, 7, 31, 77, 18, 65, 52]); my $mygraph = GD::Graph::bars->new(500, 300); $mygraph->set( x_label => 'Time taken (Hrs) for compilation', y_label => 'Environments', title => 'Production taken in the Week of $file', ) or warn $mygraph->error; my $myimage = $mygraph->plot(\@data) or die $mygraph->error; open FH, "> graph.png"; binmode FH; print FH $mygraph->plot(\@data)->png; close FH; print "Content-type: image/png\n\n"; print "raja\n"; print $myimage->png;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: draw a graph
by psini (Deacon) on Jul 31, 2009 at 13:51 UTC | |
by AnomalousMonk (Archbishop) on Jul 31, 2009 at 15:10 UTC | |
by Bloodnok (Vicar) on Jul 31, 2009 at 15:30 UTC | |
|
Re: draw a graph
by jrsimmon (Hermit) on Jul 31, 2009 at 16:24 UTC | |
|
Re: draw a graph
by Gangabass (Vicar) on Jul 31, 2009 at 14:17 UTC |