Chart::Clicker::Axis
Chart::Clicker::Axis represents the plot of the chart.
use Chart::Clicker::Axis; use Graphics::Primitive::Font; use Graphics::Primitive::Brush; my $axis = Chart::Clicker::Axis->new({ font => Graphics::Primitive::Font->new, orientation => 'vertical', position => 'left', brush => Graphics::Primitive::Brush->new, visible => 1, });
The 'baseline' value of this axis. This is used by some renderers to change the way a value is marked. The Bar render, for instance, considers values below the base to be 'negative'.
The brush for this axis.
The color of the axis' border.
The format to use for the axis values.
If the format is a string then format is applied to each value 'tick' via sprintf. See sprintf perldoc for details! This is useful for situations where the values end up with repeating decimals.
If the format is a coderef then that coderef will be executed and the value passed to it as an argument.
my $nf = Number::Format->new; $default->domain_axis->format(sub { return $nf->format_number(shift); });
The amount to 'fudge' the span of this axis. You should supply a percentage (in decimal form) and the axis will grow at both ends by the supplied amount. This is useful when you want a bit of padding above and below the dataset.
As an example, a fugdge_amount of .10 on an axis with a span of 10 to 50 would add 5 to the top and bottom of the axis.
The height of the axis.
This axis' hidden flag. If this is true then the Axis will not be drawn.
The label of the axis.
The color of the Axis' labels.
The font used for the axis' label.
The orientation of this axis. See Chart::Clicker::Drawing.
The position of the axis on the chart.
The Range for this axis.
If this is value is false then 'ticks' and their labels will not drawn for this axis.
Allows you to specify a range of values that will be skipped completely on this axis. This is often used to trim a large, unremarkable section of data. If, for example, 50% of your values fall below 10 and 50% fall above 100 it is useless to bother charting the 10 to 100 range. Skipping it with this attribute will make for a much more useful chart, albeit somewhat visually skewed.
$axis->skip_range(Chart::Clicker::Data::Range->new(lower => 10, upper => 100));
Note that any data points, including ticks, that fall inside the range specified will be completely ignored.
If true, causes horizontally labeled axes to 'stagger' the labels so that half are at the top of the box and the other half are at the bottom. This makes long, overlapping labels less likely to overlap. It only does something useful with horizontal labels.
The font used for the axis' ticks.
The angle (in radians) to rotate the tick's labels.
The color of the tick labels.
The arrayref of values show as ticks on this Axis.
Get a count of tick values.
The arrayref of labels to show for ticks on this Axis. This arrayref is consulted for every tick, in order. So placing a string at the zeroeth index will result in it being displayed on the zeroeth tick, etc, etc.
The number of 'ticks' to show. Setting this will divide the range on this axis by the specified value to establish tick values. This will have no effect if you specify tick_values.
This axis' width.
Creates a new Chart::Clicker::Axis. If no arguments are given then sane defaults are chosen.
Add a value to the list of tick values.
Clear all tick values.
Given a span and a value, returns it's pixel position on this Axis.
Given a value, returns it formatted using this Axis' formatter.
Prepare this Axis by determining the size required. If the orientation is CC_HORIZONTAL this method sets the height. Otherwise sets the width.
Draw this axis.
Documening for POD::Coverage tests, Moose stuff.
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.