Manual Reference Pages - GD::GRAPH::FAQ (3)
GD::Graph::FAQ - Frequently asked questions
Take a look at DISTRIBUTION STATUS in GD::Graph first.
I get errors like Cant call method METHOD on an undefined value. What gives?
You probably had an error somewhere, most likely in the plot() method,
and you didnt check for it. See the section on Error Handling in the
documentation for GD::Graph to find out how to deal with this sort
of thing, and how to get more information about what the error was.
I am drawing a bar chart, and the chart area is a lot smaller than the image. What is going on?
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_width attribute to a
I have my data in some format that doesnt look at all like the array that I am supposed to give to GD::Graphs plot method. Do I really need to mess around with array references?
Not necessarily. Check out the GD::Graph::Data class.
How do I stop those pesky accents appearing around bars or inside area charts?
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.
Ill probably include an option in a future version that gives better
control over this.
Where is the ActiveState ppm of GD::Graph?
Ask them. I have asked them, but didnt get an answer. I dont 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 ActiveStates ppm
archive. However, I am going to leave this question here in case they
get behind again.
Do you have some example code for me?
The distribution has a large set of examples in it. If you dont have
the original distribution, please get it from CPAN (http://www.cpan.org/
or some local mirror).
Will you support X or Y?
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 dont send me a patch, but just a question, you will have to be
patient. (Please also see the section on bugs in the main body
Why does export_format give me a weird string, instead of just png or gif?
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;
TrueType fonts dont work when I use GD::Graph from a CGI program.
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:
See the GD::Text documentation for more information about font paths.
Im trying to use GDs builtin fonts, but its not working.
Most likely, you are using the font short name, like gdGiantFont or
gdMediumBoldFont, and you have not put a use GD in your program.
This is needed, because these short names need to be exported into
your name space by the GD library:
If you dont want to include the GD library, you can use the
longer alternative names (which is what Id recommend anyway):
If you use strict then you will actually get an error message if
you try to use the short names without including the GD module.
Also see the GD::Text documentation for this information.
When I have many data sets, some end up having the same colour.
The default number of colours for data sets is seven, so if you use
more than seven data sets, those colours will be re-used for the
higher data sets.
This is described in the entry for the dclrs attribute in the
Can you tell me how to do X?
Not necessarily (X might be kind of complicated, after all).
Did you look in the samples for something similar?
If not, youre probably best off seeing if you can get
help from a group of people, rather than one or the other
of the overworked individuals whose e-mail addresses are shown below.
If youre more comfortable with asking a newsgroup for help, the
canonical resource is <comp.lang.perl.misc>; if you prefer
web forums, there is a good one at <http://www.perlmonks.org>.
In either case, if you are not familiar with the forum and its denizens,
you might wish to read the following helpful guide before posting your
Can you fix this bug Ive found?
Well, I hope so. Please see the BUGS section in the main body of
GD::Graph for the best way to report it.
Martien Verbruggen <email@example.com>
Current maintenance (including this release) by
Benjamin Warfield <firstname.lastname@example.org>
(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.
|perl v5.20.3 ||GRAPH::FAQ (3) ||2013-06-22 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.