package Imager::Graph; =head1 NAME Imager::Graph - Perl extension for producing Graphs using the Imager library. =head1 SYNOPSIS use Imager::Graph::SubClass; my $chart = Imager::Graph::SubClass->new; my $img = $chart->draw(data=>..., ...) or die $chart->error; =head1 DESCRIPTION Imager::Graph provides style information to its base classes. It defines the colors, text display information and fills based on both built-in styles and modifications supplied by the user to the draw() method. For best results you need a version of Imager after 0.38. At the time of writing this is only available via CVS: cvs -d :pserver:anoncvs@cvs.imager.perl.org:/u02/cvsroot login cvs -d :pserver:anoncvs@cvs.imager.perl.org:/u02/cvsroot co Imager This provides extra file format support, fountain (gradient), hatch and image fills, and masked images. =over =cut use strict; use vars qw($VERSION); use Imager qw(:handy); $VERSION = '0.03'; my $fancy_fills = 0; my ($im_version) = ($Imager::VERSION =~ /(\d\.[\d_]+)/); if ($im_version > 0.38) { ++$fancy_fills; require 'Imager/Fountain.pm'; } # the maximum recursion depth in determining a color, fill or number use constant MAX_DEPTH => 10; my $NUM_RE = '(?:[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]\d+?)?)'; =item new This is a simple constructor. No parameters required. =cut sub new { bless {}, $_[0]; } =item error Returns an error message. Only value if the draw() method returns false. =cut sub error { $_[0]->{_errstr}; } =item draw Creates a new image, draws the chart onto that image and returns it. Typically you will need to supply a C parameter in the format required by that particular graph, and if your graph will use any text, a C parameter You can also supply many different parameters which control the way the graph looks. These are supplied as keyword, value pairs, where the value can be a hashref containing sub values. The C