Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Chart::Clicker
Powerful, extensible charting.

Chart::Clicker - Powerful, extensible charting.


NAME

Chart::Clicker - Powerful, extensible charting.


DESCRIPTION

Chart::Clicker aims to be a powerful, extensible charting package that creates really pretty output.

Clicker leverages the power of Cairo to create snazzy 2D graphics easily and quickly.

At it's core Clicker is more of a toolkit for creating charts. It's interface is a bit more complex because making pretty charts requires attention and care. Some fine defaults are established to make getting started easier, but to really unleash the potential of Clicker you must roll up your sleeves and build things by hand.

The API is a bit intimidating, so it is recommended that you begin with the Chart::Clicker::Simple manpage.


WARNING

Clicker has aspirations to do more and be better. Good software is not Athena and therefore doesn't spring fully formed from the mind. It is entirely possible that new features will be added that may change behavior. You can find more information at http://www.onemogin.com/clicker. Feel free to send your criticisms, advice, patches or money to me as a way of helping.


FORMATS

Clicker supports PNG and SVG output.


SYNOPSIS


  use Chart::Clicker;

  use Chart::Clicker::Axis;

  use Chart::Clicker::Data::DataSet;

  use Chart::Clicker::Data::Series;

  use Chart::Clicker::Decoration::Grid;

  use Chart::Clicker::Decoration::Legend;

  use Chart::Clicker::Decoration::Plot;

  use Chart::Clicker::Drawing qw(:positions);

  use Chart::Clicker::Drawing::Insets;

  use Chart::Clicker::Renderer::Area;

  my $chart = new Chart::Clicker({ format => 'png', width => 500, height => 350 });

  my $series = new Chart::Clicker::Data::Series({

    keys    => [1, 2, 3, 4, 5, 6],

    values  => [12, 9, 8, 3, 5, 1]

  });

  my $dataset = new Chart::Clicker::Data::DataSet({

    series => [ $series ]

  });

  $chart->datasets([ $dataset ]);

  my $legend = new Chart::Clicker::Decoration::Legend({

    margins => new Chart::Clicker::Drawing::Insets({

        top => 3

    })

  });

  $chart->add($legend, $CC_BOTTOM);

  my $daxis = new Chart::Clicker::Axis({

    orientation => $CC_HORIZONTAL,

    position    => $CC_BOTTOM,

    format      => '%0.2f'

  });

  $chart->add($daxis, $CC_AXIS_BOTTOM);

  my $raxis = new Chart::Clicker::Axis({

    orientation => $CC_VERTICAL,

    position    => $CC_LEFT,

    format      => '%0.2f'

  });

  $chart->add($raxis, $CC_AXIS_LEFT);

  $chart->range_axes([ $raxis ]);

  $chart->domain_axes([ $daxis ]);

  my $grid = new Chart::Clicker::Decoration::Grid();

  $chart->add($grid, $CC_CENTER, 0);

  my $renderer = new Chart::Clicker::Renderer::Area();

  $renderer->options({

    fade => 1

  });

  my $plot = new Chart::Clicker::Decoration::Plot();

  $plot->renderers([$renderer]);

  $chart->plot($plot);

  $chart->add($plot, $CC_CENTER);

  $chart->prepare();

  $chart->draw();

  $chart->write('/path/to/chart.png');


METHODS

Constructor

new
Creates a new Chart::Clicker object. If no format, width and height are specified then defaults of png, 500 and 300 are chosen, respectively.

Class Methods

inside_width
Get the width available in this container after taking away space for insets and borders.

inside_height
Get the height available in this container after taking away space for insets and borders.

draw
Draw this chart

add_to_markers
Add the specified marker to the chart.

add_to_datasets
Add the specified dataset (or array or datasets) to the chart.

prepare
Prepare this chart for rendering.

set_dataset_domain_axis

  $chart->set_dataset_domain_axis($dataset_index, $axis_index)

Affines the dataset at the specified index to the domain axis at the second index.

get_dataset_domain_axis

  my $axis = $chart->get_dataset_domain_axis($index)

Returns the domain axis to which the specified dataset is affined.

set_dataset_range_axis

  $chart->set_dataset_range_axis($dataset_index, $axis_index)

Affines the dataset at the specified index to the range axis at the second index.

get_dataset_range_axis

  my $axis = $chart->get_dataset_range_axis($index)

Returns the range axis to which the specified dataset is affined.

write
Write the chart output to the specified location. Output is written in the format provided to the constructor (which defaults to png).

  $c->write('/path/to/the.png');

data
Returns the data for this chart as a scalar. Suitable for 'streaming' to a client.


AUTHOR

Cory 'G' Watson <gphat@cpan.org>


CONTRIBUTORS

Torsten Schoenfeld


SEE ALSO

perl(1)


LICENSE

You can redistribute and/or modify this code under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy