in reply to save a png image

You have to check for errors occuring during graph-creation:

my $gd_image = $graph->plot(\@data);
should be
my $gd_image = $graph->plot(\@data) or die $graph->error;
If an error occures, $gd_image will be undefined, resulting in the error you experience.

die according to the GD::Graph-docs and you will probably be told were the error lies...

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.

Replies are listed 'Best First'.
Re: Re: save a png image
by Anonymous Monk on Mar 09, 2004 at 16:28 UTC
    i have the lines above it commented out above itcos the graph is being created but it wont display multiple images to the screen so i trying to save them and display them embedded in html so that the user can see many images on the page.. tanx for the advice ill add that to the code though

      Maybe some Monks don't mind as much as I do, but please, please, please at least try to write coherently. Capitalization would help. Perhaps breaking up your big, long, breathless sentence with this neat little thing I like to call a "period." It would help, I promise.