Chart::Clicker - Powerful, extensible charting.
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.
Clicker is in heavy development. The interface is not optimal, there are features missing, and pieces of it flat out do not work. Good software is not Athena and therefore doesn't spring fully formed from the mind. It will take some time to nail down the interface. 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.
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 $c = new Chart::Clicker({ 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 ] }); 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->add($plot, $CC_CENTER); $chart->prepare(); $chart->draw(); $chart->write('/path/to/chart.png');
Creates a new Chart::Clicker object. If no width and height are specified then defaults of 500 and 300 are chosen, respectively.
Get the width available in this container after taking away space for insets and borders.
Get the height available in this container after taking away space for insets and borders.
Draw this chart
Prepare this chart for rendering.
$chart->set_dataset_domain_axis($dataset_index, $axis_index)
Affines the dataset at the specified index to the domain axis at the second index.
my $axis = $chart->get_dataset_domain_axis($index)
Returns the domain axis to which the specified dataset is affined.
$chart->set_dataset_range_axis($dataset_index, $axis_index)
Affines the dataset at the specified index to the range axis at the second index.
my $axis = $chart->get_dataset_range_axis($index)
Returns the range axis to which the specified dataset is affined.
Write the resulting png file to the specified location.
$c->write('/path/to/the.png');
Returns the PNG data as a scalar.
Cory 'G' Watson <gphat@cpan.org>
perl(1)
You can redistribute and/or modify this code under the same terms as Perl itself.
To install Chart::Clicker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chart::Clicker
CPAN shell
perl -MCPAN -e shell install Chart::Clicker
For more information on module installation, please visit the detailed CPAN module installation guide.