in reply to Re: GD::Graph question
in thread GD::Graph question
use strict; use CGI ':standard'; use GD::Graph::lines; use CGI::Carp qw(fatalsToBrowser); my $query = new CGI; print header(), start_html( -title=> "curves", -BGCOLOR=>"#ffffff"); my @data = ( ["31768","25498", "21736", "17138", "9614", "6688", "5016", + "4180", "-2508", "-3762", "-5434", "-10450", "-12122", "-17138", "-2 +0482", "-20900"], [84.44, 68.55, 56.43, 39.71, 26.57, 15.05, 7.11, 1.93, -9.6 +1, -17.56, -22.15, -34.69, -40.96, -48.91, -63.95, -71.04] ); my $graph = GD::Graph::lines ->new (600,600); $graph-> set( x_label => 'Temp', y_label => 'Amount', title => 'Tria graph', y_max_value=>100 ) or warn $graph->error; $graph->set (dclrs=> [qw(green red blue)]); my $gb = $graph->plot (\@data) or die $graph->error; print "Content-type: image/png\n\n"; binmode (STDOUT); print $gb->png;
|
|---|