Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl5 use GD::Graph; use GD::Graph::lines; use CGI; my $query = new CGI; @data = ( ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], [ 1, 2, 5, 6, 3, 1.5, 1, 3, 4], [ sort { $a <=> $b } (1, 2, 5, 6, 3, 1.5, 1, 3, 4) ] ); my $format; print "Content-type: image/png\n\n"; # create a new graph my $graph = GD::Graph::lines->new(400,400); $graph->set( x_label => 'X Label', y_label => 'Y label', title => 'Some simple graph', ); $format = $graph->export_format; print $query->header("image/$format"); binmode STDOUT; #(the parentheses after $format are necessary, to help the compiler + decide that # you mean a method name here) print $graph->plot(\@data)->$format();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GDGraph charts
by btrott (Parson) on Jul 17, 2000 at 22:59 UTC | |
|
(chromatic) Re: GDGraph charts
by chromatic (Archbishop) on Jul 18, 2000 at 02:46 UTC |