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(
_items => [
{ axis => {
x_fractional_ticks => scalar(@x),
y_fractional_ticks => scalar(@x),
stroke => $stroke, },
data => [ [ 0, 0 ], [ 1, 1 ] ],
line => $line,
},
{ 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.
An axis must be specified for this module to display any data. This can be done by adding standard SVG::Graph
axis items or by providing an _axis hash reference. This feature is under developement. Please see the eg/normalize-primes
program for a working example.
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>