Chart-Clicker
view release on metacpan or search on metacpan
README.mkdn view on Meta::CPAN
similar things, you can use:
# ... make your chart
$cc->draw;
my $image_data = $cc->rendered_data;
If you happen to be using Catalyst then take a look at
[Catalyst::View::Graphics::Primitive](https://metacpan.org/pod/Catalyst::View::Graphics::Primitive).
# ATTRIBUTES
## background\_color
Set/Get the background [color](https://metacpan.org/pod/Graphics::Color::RGB). Defaults to white.
## border
Set/Get the [border](https://metacpan.org/pod/Graphics::Primitive::Border).
## color\_allocator
Set/Get the [color\_allocator](https://metacpan.org/pod/Chart::Clicker::Drawing::ColorAllocator) for this chart.
## contexts
Set/Get the [contexts](https://metacpan.org/pod/Chart::Clicker::Context) for this chart.
## datasets
Get/Set the datasets for this chart.
## driver
Set/Get the [driver](https://metacpan.org/pod/Graphics::Primitive::Driver) used to render this Chart. Defaults to
[Graphics::Primitive::Driver::Cairo](https://metacpan.org/pod/Graphics::Primitive::Driver::Cairo).
## format
Get the format for this Chart. Required in the constructor. Must be on of
Png, Pdf, Ps or Svg.
## plot\_mode
Fast or slow plot mode. When in fast mode, data elements that are deemed to be
superfluous or invisible will not be drawn. Default is 'slow'
## grid\_over
Flag controlling if the grid is rendered **over** the data. Defaults to 0.
You probably want to set the grid's background color to an alpha of 0 if you
enable this flag.
## height
Set/Get the height. Defaults to 300.
## layout\_manager
Set/Get the layout manager. Defaults to [Layout::Manager::Compass](https://metacpan.org/pod/Layout::Manager::Compass).
## legend
Set/Get the [legend](https://metacpan.org/pod/Chart::Clicker::Decoration::Legend) that will be used with this chart.
## legend\_position
The position the legend will be added. Should be one of north, south, east,
west or center as required by [Layout::Manager::Compass](https://metacpan.org/pod/Layout::Manager::Compass).
## marker\_overlay
Set/Get the [marker overlay](https://metacpan.org/pod/Chart::Clicker::Decoration::MarkerOverlay) object that will be used if this chart
has markers. This is lazily constructed to save time.
## over\_decorations
Set/Get an arrayref of "over decorations", or things that are drawn OVER the
chart. This is an advanced feature. See `overaxis-bar.pl` in the examples.
## padding
Set/Get the [padding](https://metacpan.org/pod/Graphics::Primitive::Insets). Defaults
to 3px on all sides.
## plot
Set/Get the [plot](https://metacpan.org/pod/Chart::Clicker::Decoration::Plot) on which things are drawn.
## subgraphs
You can add "child" graphs to this one via `add_subgraph`. These must be
Chart::Clicker objects and they will be added to the bottom of the existing
chart. This is a rather esoteric feature.
## title
Set/Get the title component for this chart. This is a
[Graphics::Primitive::TextBox](https://metacpan.org/pod/Graphics::Primitive::TextBox), not a string. To set the title of a chart
you should access the TextBox's `text` method.
$cc->title->text('A Title!');
$cc->title->font->size(20);
# etc, etc
If the title has text then it is added to the chart in the position specified
by `title_position`.
You should consult the documentation for [Graphics::Primitive::TextBox](https://metacpan.org/pod/Graphics::Primitive::TextBox) for
things like padding and text rotation. If you are adding it to the top and
want some padding between it and the plot, you can:
$cc->title->padding->bottom(5);
## title\_position
The position the title will be added. Should be one of north, south, east,
west or center as required by [Layout::Manager::Compass](https://metacpan.org/pod/Layout::Manager::Compass).
Note that if no angle is set for the title then it will be changed to
\-1.5707 if the title position is east or west.
## width
Set/Get the width. Defaults to 500.
# METHODS
( run in 0.613 second using v1.01-cache-2.11-cpan-39bf76dae61 )