GD::Graph - Frequently asked questions
As of version 1.30, GD::Graph automatically corrects the width of the plotting area of a chart if it needs to draw bars (i.e. for bars and some mixed charts). This is necessary, because rounding errors cause irregular gaps between or overlaps of bars if the bar is not an exact integer number of pixels wide.
If you want the old behaviour back, set the correct_with attribute to a false value.
Not necessarily. Check out the GD::Graph::Data class.
You can set the accent_treshold option to a large enough value (larger than your chart). Alternatively, you may like it better to set the borderclrs attribute to be the same as the dclrs one.
accent_treshold
borderclrs
I'll probably include an option in a future version that gives better control over this.
Ask them. I have asked them, but didn't get an answer. I don't know what to do to get it included in their set of ppms, and I really do not have the time to keep asking them.
I believe that GD::graph has finally made it into ActiveState's ppm archive. However, I am going to leave this question here in case they get behind again.
The distribution has a large set of examples in it. If you don't have the original distribution, please get it from CPAN (http://www.cpan.org/ or some local mirror).
If you send me a patch that (in a decent manner) adds the functionality to the latest version, I may very well add it for the next release. If you don't send me a patch, but just a question, you will have to be patient.
As of version 1.31, export_format in a list context returns all formats that GD can export. If you are only interested in the answer 'gif' or 'png', make sure that you call it in a scalar context.
$export_format = GD::Graph->export_format; $export_format = $graph->export_format; print "Export format is ", scalar $graph->export_format, "\n"; print "Export format is " . $graph->export_format . "\n"; @export_formats = $graph->export_format;
When your programs run as CGI, they typically do not have the same environment as when you use them from the command line. The Perl FAQ, section 9, has some information on this. It is also not guaranteed that your script runs from the directory that it is in. It is probably better to include something like:
use GD::Text; GD::Text->font_path("/path/to/my/font_dir");
See the GD::Text documentation for more information about font paths.
Martien Verbruggen <mgjv@tradingpost.com.au>
(c) Martien Verbruggen.
All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install GD::Graph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GD::Graph
CPAN shell
perl -MCPAN -e shell install GD::Graph
For more information on module installation, please visit the detailed CPAN module installation guide.