SVG::TT::Graph

Base object for generating SVG Graphs
Download

SVG::TT::Graph Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Florent Angly
  • Publisher web site:
  • http://search.cpan.org/~fangly/

SVG::TT::Graph Tags


SVG::TT::Graph Description

SVG::TT::Graph is a Perl module that should be used as a base for creating SVG graphs. If XML::Tidy is installed, the SVG files generated are tidied.See SVG::TT::Graph::Line for an example.SYNOPSIS package SVG::TT::Graph::GRAPH_TYPE; use SVG::TT::Graph; use base qw(SVG::TT::Graph); use vars qw($VERSION); $VERSION = $SVG::TT::Graph::VERSION; $TEMPLATE_FH = \*DATA; sub _set_defaults { my $self = shift; my fault = ( 'keys' => 'value', ); while( my ($key,$value) = each fault ) { $self->{config}->{$key} = $value; } } # optional - called when object is created sub _init { my $self = shift; # any testing you want to do. } ... 1; __DATA__ In your script: use SVG::TT::Graph::GRAPH_TYPE; my $width = '500', my $heigh = '300', my @fields = qw(field_1 field_2 field_3); my $graph = SVG::TT::Graph::GRAPH_TYPE->new({ # Required for some graph types 'fields' => \@fields, # .. other config options 'height' => '500', }); my @data = qw(23 56 32); $graph->add_data({ 'data' => \@data, 'title' => 'Sales 2002', }); # find a config options value my $config_value = $graph->config_option(); # set a config option value $graph->config_option($config_value); # All graphs support SVGZ (compressed SVG) if # Compress::Zlib is available. Use either the # 'compress' => 1 config option, or: $graph->compress(1); # All graph SVGs can be tidied if XML::Tidy # is installed. Use either the 'tidy' => 1 # config option, or: $graph->tidy(1); print "Content-type: image/svg+xml\n\n"; print $graph->burn();Product's homepage


SVG::TT::Graph Related Software