NAME

SVG::Graph::Kit - Simplified data plotting

SYNOPSIS

use SVG::Graph::Kit;
my $r = shift || 50;
my $m = shift || 20;
my $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' => 'black', 'stroke-width' => 2 },
      },
      { data => [ map { [ $i++, int(rand $r)] }
          qw(2 3 5 7 11 13 17 19 23 29 31 37 41) ],
        scatter => { fill => 'white', 'fill-opacity' => 1,
          stroke => 'blue' },
        line => { fill => 'yellow', 'fill-opacity' => 0.5,
          stroke => 'yellow' },
      },
      { data => [ map { [int(rand $r), int(rand $r)] } 0 .. $m ],
        bar => { fill => 'green', 'fill-opacity' => 0.5,
          stroke => 'green' },
      },
  ],
);

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 or a list of SVG::Graph::Data::Datum points.

SEE ALSO

SVG::Graph

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>