in reply to Coaking GDGraph to work...
The first array contains the X-values, and the rest of the arrays contain the Y-values to be plotted. After that, you do something like this: (untested)my @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) ] );
# Create GD::Graph object my $graph = GD::Graph->new(400, 300); # Optionally set graph attributes $graph->set(x_label => "X Label", y_label => "Y Label"); # Create the graph itself my $gd = $graph->plot(\@data); # And output the file on STDOUT (redirect to a file, # or open a file yourself print $gd->png;
Most of this comes from the excellent GD::Graph documentation. Read it :-)
Arjen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Coaking GDGraph to work...
by zakzebrowski (Curate) on Feb 04, 2003 at 14:24 UTC |