perl -MCPAN -e shell
and type
install GD::Graph
to install the package. Watch the screen carefully to find out whether any tests fail. Most of the times failed tests are the cause for installation failure. If a test fails, you can try to force the installation by doing
force install GD::Graph
During installation you might be asked whether to install additional packages that GD::Graph dependends on. In that case, say yes.
If CPAN isn't installed in your ActiveState Perl distribution, use PPM to install CPAN and then use CPAN to install your package.
Oh, I found the following on this [aspn.activestate.com] page:
GDThe GD module currently isn't available in the ActiveState PPM repository. This is because it is very difficult to build and is not suitable for ActiveState's automated build system, as it requires quite a external libraries. PPMs for the GD module can be found in other repositories and installed as follows:
ppm install [theoryx5.uwinnipeg.ca...]
This will install the GD PPM from the University of Winnipeg's version 5.8 PPM repository. For the 5.6 PPM repository, use:
ppm install [theoryx5.uwinnipeg.ca...]
I don't get any error from the code posted below. But i don't get a png file either. does anyone have good documentation on this
#!/usr/local/bin/perl -w
print "Content-Type: text/html\n\n";
use CGI;
use File::Copy;
use CGI qw(:standard);
use DBI;
use Chart::Graph::Gnuplot qw(&gnuplot);
gnuplot({"title" => "foo",
"x2-axis label" => "bar",
"logscale x2" => "1",
"logscale y" => "1",
"output type" => "png",
"output file" => "/raid5/newhome/hmdc/gnuplot1.png",
"xtics" => [ ["small\\nfoo", 10], ["medium\\nfoo", 20], ["large\\nfoo", 30] ],
"ytics" => [10,20,30,40,50]},
"xdata" => "time",
"format" => ["x", "%m/%d"],
"timefmt"=> $date_format,
"extra_opts" => "set key left top Left",
[{"title" => "data1",
"type" => "matrix"}, [[1, 10],
[2, 20],
[3, 30]] ],
[{"title" => "data2",
"style" => "lines",
"type" => "columns"}, [8, 26, 50, 60, 70],
[5, 28, 50, 60, 70] ],
[{"title" => "data3",
"style" => "lines",
"type" => "file"}, "samplefile"],);