NAME
SVG::Graph::Kit - Simplified data plotting
SYNOPSIS
use SVG::Graph::Kit;
my @x = qw(2 3 5 7 11 13 17 19 23 29 31 37 41);
my $i = 0;
my $data = [ map { [ ++$i, $_ ] } @x ];
my $g = SVG::Graph::Kit->new(
_autoaxis => { m => @x, n => $x[-1], s => @x, },
_items => [
{ data => $data, line => { stroke => 'yellow'}, },
{ data => $data, scatter => { stroke => 'blue' }, },
],
);
print $g->draw;
DESCRIPTION
An SVG::Graph::Kit
object is a simplified, automated tool that allows data plotting without requiring knowledge of the SVG::Graph
API.
PUBLIC METHODS
new
my $obj = SVG::Graph::Kit->new(%arguments);
Return a new SVG::Graph::Kit
instance with any given data or glyphs automatically added to the plot.
This method can be called with any valid SVG::Graph
construction parameters (e.g. width, height, margin) plus an _items list of things to show - data and glyphs. The glyphs are defined by SVG::Graph
and the actual data can be either a 1-D list of numbers, an array reference of 1, 2 or 3-D data points, a hash reference with "x, y, z" keyed coordinates, a list of SVG::Graph::Data::Datum
points or a SVG::Graph::Data
object.
If this method is invoked with the optional _autoaxis parameter, an axis with scaled labels and grid-lines is automatically added to the graph. This parameter should be a hash reference having keys m, n and s that are used as the number of ticks plotted and the largest tick desired and the scaling factor, respectively.
SEE ALSO
COPYRIGHT
Copyright 2006, Gene Boggs, All Rights Reserved
LICENSE
You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version.
AUTHOR
Gene Boggs <gene@cpan.org>