Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
KH*՚@fr'HxA&%4ڃp!7)*R9a
Can anyone tell me whats wrong with the script? The graph is created and printed to file.gif, but is not displayed on my cgi webpage.
Thanks!
@data = ( ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], [ 1, 2, 5, 6, 3, 1.5, 1, 3, 4] ); + my $graph = GD::Graph::points->new(400, 300); + $graph->set( x_label => 'X Label', y_label => 'Y label', title => 'Some simple graph', y_max_value => 8, y_tick_number => 8, y_label_skip => 2 ) or die $my_graph->error; + + my $gd = $graph->plot(\@data) or die $my_graph->error; open(IMG, '>file.gif') or die $!; binmode IMG; print IMG $gd->png; close IMG; binmode STDOUT; print $gd->png;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GD graphs and CGI
by borisz (Canon) on Jan 19, 2005 at 13:32 UTC | |
|
Re: GD graphs and CGI
by friedo (Prior) on Jan 19, 2005 at 15:13 UTC | |
|
Re: GD graphs and CGI
by r34d0nl1 (Pilgrim) on Jan 20, 2005 at 12:53 UTC |