(
'title' => 'Bar chart test',
);
print $chart->render_swf(600, 400, 'chart-data.json', 'test-chart');
OFC2 bar chart data:
use Chart::OFC2;
use Chart::OFC2::Axis;
use C
lash
Chart 2 is offering. But it should help you to starting creating OFC2
graphs quite fast. The JSON format is quite intuitive and can be created
from any hash. This module is more like guideline.
2 is a flash script for creating graphs. To have a graph we need an
F<open-flash-chart.swf> and a JSON data file describing graph data.
Complete examples you can find after successful run of this modu
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
return {
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
return {
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
my %hash = (
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my ($self) = @_;
return {
m
li><a href="http://cpansearch.perl.org/src/JKUTEJ/Chart-OFC2-0.08_01/examples/for-pod/bar-data.json">json source</a></li>
</ul>
=end html
=cut
use Moose;
use MooseX::StrictConstructor;
our $VERSIO
ON
extends 'Chart::OFC2::BarLineBase';
In L<Chart::OFC2::HBarValues> when converting values to JSON the values are
reversed. This is done so that the C<y_axis->labels> match to the values.
Also not
_JSON()
Returns ArrayRef that is possible to give to C<encode_json()> function.
NOTE: values are reversed. This is done so that the C<y_axis->labels> match to
the values properly.
=cut
sub TO_JSON
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
return {
map
too
=head1 METHODS
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my ($self) = @_;
my %json = (
map { my $v = $se
{ $_->name } $self->meta->get_all_attributes
);
$json{'3d'} = delete $json{'is3d'}
if (exists $json{'is3d'});
return \%json;
}
=head2 color()
Same as colour().
=cut
sub color
('colours' => \@colours) : ())
);
}
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my ($self) = @_;
my @values_with_la
THODS
=head2 new()
Object constructor.
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
return {
li><a href="http://cpansearch.perl.org/src/JKUTEJ/Chart-OFC2-0.08_02/examples/for-pod/pie-data.json">json source</a></li>
</ul>
=end html
=cut
use Moose;
use MooseX::StrictConstructor;
our $VERSIO
s 'values' => (is => 'rw', isa => 'Chart::OFC2::PieValues', 'coerce' => 1,);
override 'TO_JSON' => sub {
my $self = shift;
my $pie_element = super();
# get the colours fr
is_max($max)
if defined $max;
}
=head2 TO_JSON()
Returns HashRef that is possible to give to C<encode_json()> function.
=cut
sub TO_JSON {
my $self = shift;
return {