Jul 16, 2010, 12:54 PM
Post #1 of 3
Can't locate object method "png" via package "GD::Graph::bars" ...
I'm working through a book on Perl graphics but when I execute the following code I get the error message:
Can't locate object method "png" via package "GD::Graph::bars".
find `perl -e 'print "@INC"'` -name '*.pm' -print | grep bars --> indicated the module was present.
Any help would be appreciated. Thanks
my @data = (
[ 8, 3, 1, 2],
my $chart = GD::Graph::bars->new(700,500);
$chart->set(title => 'Ostrich diet');
my $gd_object = $chart->plot(\@data);
open(PIC, '>picfile.png') or die "Could not open the picture file.\n";
# make sure we are writing to a binary stream
# Convert the image to PNG and print it on standard output
print PIC $chart->png;