Chart::Plot::Canvas - Plot two dimensional data in an Tk Canvas.
use Chart::Plot::Canvas; my $img = Chart::Plot::Canvas->new(); my $anotherImg = Chart::Plot::Canvas->new ($image_width, $image_height); $img->setData (\@dataset) or die( $img->error() ); $img->setData (\@xdataset, \@ydataset); $img->setData (\@anotherdataset, 'red_dashedline_points'); $img->setData (\@xanotherdataset, \@yanotherdataset, 'Blue SolidLine NoPoints'); my ($xmin, $ymin, $xmax, $ymax) = $img->getBounds(); $img->setGraphOptions ('horGraphOffset' => 75, 'vertGraphOffset' => 100, 'title' => 'My Graph Title', 'horAxisLabel' => 'my X label', 'vertAxisLabel' => 'my Y label' ); print $img->draw(); $img->canvas($toplevel)->pack();
This package overloads Chart::Plot and supplies a new method 'canvas' that returns a Tk Canvas equivalent to GD::Image returned by the method 'draw' of Chart::Plot.
The graphs are descripted by same way as for Chart::Plot.
With Chart::Plot::Canvas, the method 'draw' works like with Chart::Plot.
See Chart::Plot for all over methods.
$img->canvas(toplevel);
This method creates the canvas and returns it.
use Chart::Plot::Canvas; my $img = Chart::Plot->new(); $img->setData (\@xdataset, \@ydataset); my $cv = $img->canvas($toplevel); $cv->pack();
Chart::Plot
(c) 2003-2011 Francois PERRAD, France. All rights reserved.
This library is distributed under the terms of the Artistic Licence 2.0.
Francois PERRAD, francois.perrad@gadz.org
To install Chart::Plot::Canvas, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chart::Plot::Canvas
CPAN shell
perl -MCPAN -e shell install Chart::Plot::Canvas
For more information on module installation, please visit the detailed CPAN module installation guide.