NAME

Catalyst::View::SVGTTGraph - SVG Graph View Component for Catalyst

SYNOPSIS

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.

DESCRIPTION

Catalyst::View::SVGTTGraph is Catalyst view handler of SVG::TT::Graph.

METHODS

new

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'}.

process

create SVG Graph

$c->svgttg->create

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});

$c->svgttg->graph_obj

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(....);

$c->svgttg->burn

throws to SVG::TT::Graph->burn

$c->svgttg->burn;

$c->svgttg->clear

clear $c->stash->{'Catalyst::View::SVGTTGraph'}

SEE ALSO

Catalyst, SVG::TT::Graph

AUTHOR

Shota Takayama, shot[atmark]bindstorm.jp

COPYRIGHT AND LICENSE

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.