The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chart::Clicker::Axis

DESCRIPTION

Chart::Clicker::Axis represents the plot of the chart.

SYNOPSIS

  use Chart::Clicker::Axis;
  use Chart::Clicker::Drawing qw(:positions);
  use Chart::Clicker::Drawing::Color;
  use Chart::Clicker::Drawing::Font;
  use Chart::Clicker::Drawing::Stroke;

  my $axis = new Chart::Clicker::Axis({
    color => new Chart::Clicker::Drawing::Color({ name => 'black' }),
    font  => new Chart::Clicker::Drawing::Font(),
    orientation => $CC_VERTICAL,
    position => $CC_LEFT,
    show_ticks => 1,
    stroke = new Chart::Clicker::Drawing::Stroke(),
    tick_length => 2,
    tick_stroke => new Chart::Clicker::Drawing::Stroke(),
    visible => 1,
  });

METHODS

Constructor

Chart::Clicker::Axis->new()

Creates a new Chart::Clicker::Axis. If no arguments are given then sane defaults are chosen.

Class Methods

color

Set/Get the color of the axis.

font

Set/Get the font used for the axis' labels.

format

Set/Get the format to use for the axis values. The format is applied to each value 'tick' via sprintf(). See sprintf()s perldoc for details! This is useful for situations where the values end up with repeating decimals.

height

Set/Get the height of the axis.

label

Set/Get the label of the axis.

orientation

Set/Get the orientation of this axis.

per

Set/Get the 'per' value for the axis. This is how many physical pixels a unit on the axis represents. If the axis represents a range of 0-100 and the axis is 200 pixels high then the per value will be 2.

position

Set/Get the position of the axis on the chart.

range

Set/Get the Range for this axis.

show_ticks

Set/Get the show ticks flag.

stroke

Set/Get the stroke for this axis.

tick_length

Set/Get the tick length

tick_stroke

Set/Get the stroke for the tick markers.

tick_values

Set/Get the arrayref of values show as ticks on this Axis.

ticks

Set/Get the number of 'ticks' to show. Setting this will divide the range on this axis by the specified value to establish tick values.

mark

Given a value, returns it's position on this axis.

format_value

Given a value, returns it formatted using this Axis' formatter.

examine_values

Gives the axis an opportunity to examine values.

prepare

Prepare this Axis by determining the size required. If the orientation is CC_HORIZONTAL this method sets the height. Otherwise sets the width.

draw

Draw this axis.

visible

Set/Get this axis visibility flag.

width

Set/Get this axis' width.

AUTHOR

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

SEE ALSO

perl(1)

LICENSE

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