Catalyst::View::SVGTTGraph - SVG Graph View Component for Catalyst
in your config.
$c->config->{'View::SVGTTGraph'}->{image_format} = 'png';
Supported formats are 'Image::LibRSVG->getSupportedFormats()' call to see.
in your View.
package MyApp::View::SVGTTGraph; use base 'Catalyst::View::SVGTTGraph';
in your controller.
sub pie_graph : Local { my @fields = qw(Jan Feb Mar); my @data_sales_02 = qw(12 45 21); $c->svgttg->create('Pie', {'height' => '500', 'width' => '300', 'fields' => \@fields, }); $c->svgttg->graph_obj->add_data({ 'data' => \@data_sales_02, 'title' => 'Sales 2002', }); } sub end : Private { my ( $self, $c ) = @_; $c->forward('Catalyst::View::SVGTTGraph'); }
and see SVG::TT::Graph.
Catalyst::View::SVGTTGraph is Catalyst view handler of SVG::TT::Graph.
this method makes method named $c->svgttg. $c->svgttg is an accessor to the object of Catalyst::View::SVGTTGraphObj. $c->svgttg uses $c->stash->{'Catalyst::View::SVGTTGraph'}.
create SVG Graph
The object of new SVG::TT::Graph is made. Please input the kind of the graph to the first argument. Thereafter, it comes to be able to use $c->svgttg->graph_obj.
$c->svgttg->create('Bar'); or $c->svgttg->create('Bar', {'height' => '500', 'width' => '300', 'fields' => \@fields});
It accesses the object of SVG::TT::Graph. Please use it after calling $c->svgttg->create.
$c->svgttg->graph_obj->add_data(....); $c->svgttg->graph_obj->add_data(....);
throws to SVG::TT::Graph->burn
$c->svgttg->burn;
clear $c->stash->{'Catalyst::View::SVGTTGraph'}
Catalyst, SVG::TT::Graph
Shota Takayama, shot[atmark]bindstorm.jp
shot[atmark]bindstorm.jp
Copyright (c) Shanon, Inc. All Rights Reserved. http://www.shanon.co.jp/
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::View::SVGTTGraph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::SVGTTGraph
CPAN shell
perl -MCPAN -e shell install Catalyst::View::SVGTTGraph
For more information on module installation, please visit the detailed CPAN module installation guide.