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;
while( (my $p = <>) =~ s/\D//g && ++$i <= $max ) {
push @x, $p;
}
$i = 0;
my $g = SVG::Graph::Kit->new(
width => 600, height => 600, margin => 30,
items => [
{ axis => { 'x_absolute_ticks' => 1, 'y_absolute_ticks' => 1,
'stroke' => 'gray', },
data => [ [0,0], [ $x[-1], $x[-1] ] ],
line => { stroke => 'gray' },
},
{ data => [ map { [ ++$i, $_ ] } @x ],
line => { stroke => 'yellow' },
scatter => { stroke => 'blue' },
},
],
);
print $g->draw;
DESCRIPTION
An SVG::Graph::Kit
object is a simplified, restricted, automatic data plotting tool that let's you plot data without needing to handle nested frames or coordinate mapping.
PUBLIC METHODS
new
my $obj = SVG::Graph::Kit->new(%arguments);
Return a new SVG::Graph::Kit
instance with any data or glyph items automatically added to the plot.
The arguments can be any valid SVG::Graph
construction parameters, like width and height, plus an item list of data and glyphs. The glyphs are defined by SVG::Graph
. The data can be a 1D 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.
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>