Chart:...::Axis(3pm)
β¨ Chart::...::Axis π
okay bestie, welcome to Chart::...::Axis, aka An X or Y Axis β from the User Contributed Perl Documentation crew π«Ά
πΈ VERSION πΈ
version 2.90 β she's serving, she's current, she's iconic π
π SYNOPSIS π
no cap, here's the vibe:
use Chart::Clicker::Axis;
use Graphics::Primitive::Font;
use Graphics::Primitive::Brush;
my $axis = Chart::Clicker::Axis->new({
label_font => Graphics::Primitive::Font->new,
orientation => 'vertical',
position => 'left',
brush => Graphics::Primitive::Brush->new,
visible => 1,
});
look at her. main character energy fr fr β¨
π¦ DESCRIPTION π¦
Chart::Clicker::Axis represents the plot of the chart. that's it, that's the whole thing β she IS the plot. literally the moment. π
π ATTRIBUTES π
πΈ height
The height of the axis.
πΈ width
This axis' width.
πΈ tick_label_angle
The angle (in radians) to rotate the tick's labels. spin her around bestie π«
πΈ tick_division_type
This one picks the algorithm for dividing the graph axis into labelled ticks, iykyk.
The algorithms currently included are: "Exact" in Chart::Clicker::Data::DivisionType::Exact, and "LinearRounded" in Chart::Clicker::Data::DivisionType::LinearRounded.
You may write your own by providing a Moose Role which includes Role Chart::Clicker::Data::DivisionType and prefixing the module name with + when setting tick_division_type.
Chart::Clicker::Axis->new(tick_division_type => '+MyApp::TickDivision');
This value should only be set once per axis. one and done, don't come back for seconds π
πΈ baseline
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'. so like, the line between "slay" and "girl what" π
πΈ brush
The brush for this axis. Expects a Graphics::Primitve::Brush. (yes that spelling is in the original, we don't fix, we only vibe)
πΈ color
The color of the axis' border. Expects a Graphics::Color::RGB object. Defaults to black. π€ classic, timeless, never misses.
πΈ format
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. (looking at you, numbers that go on forever π)
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); });
πΈ fudge_amount
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. a lil breathing room, a lil personal space, we love to see it π«Ά
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.
πΈ hidden
This axis' hidden flag. If this is true then the Axis will not be drawn. she's shy, she's off the grid, we respect it π
πΈ label
The label of the axis.
πΈ label_color
The color of the Axis' labels. Expects a Graphics::Color::RGB object.
πΈ label_font
The font used for the axis' label. Expects a Graphics::Primitive::Font object.
πΈ layout_manager
Set/Get the Layout Manager. Defaults to Layout::Manager::Absolute.
πΈ orientation
The orientation of this axis. See Graphics::Primitive::Oriented.
πΈ position
The position of the axis on the chart.
πΈ range
The Range for this axis. Expects a Chart::Clicker::Data::Range object. You may use this to explicitly set an upper and lower bound for the chart:
$axis->range->max(1000);
$axis->range->min(1);
setting your own boundaries? obsessed. π
πΈ show_ticks
If this is value is false then 'ticks' and their labels will not drawn for this axis. (grammar found dead in a ditch but the meaning ate π₯)
πΈ staggered
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. no cap, this is the social distancing of axis labels β¨
πΈ skip_range
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. girl they are GONE gone. π₯
πΈ tick_font
The font used for the axis' ticks. Expects a Graphics::Primitive::Font object.
πΈ tick_label_color
The color of the tick labels. Expects a Graphics::Color::RGB object.
πΈ tick_labels
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. index 0 gets first dibs, no cutting the line bestie π
πΈ tick_values
The arrayref of values show as ticks on this Axis.
πΈ ticks
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. (she simply will not be listened to π)
π§ METHODS π§
πΈ add_to_tick_values
Add a value to the list of tick values.
πΈ clear_tick_values
Clear all tick values. poof. gone. cleanup era π§Ή
πΈ tick_value_count
Get a count of tick values. math girlies rise π
πΈ mark
Given a span and a value, returns it's pixel position on this Axis.
πΈ format_value
Given a value, returns it formatted using this Axis' formatter.
πΈ divvy
Retrieves the divisions or ticks for the axis. sharing is caring fr fr π«Ά
π AUTHOR π
Cory G Watson <gphat@cpan.org> β the icon, the legend, the moment π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2016 by Cory G Watson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free software ate and left no crumbs π
and that's the whole page bestie, no notes β¨
sign-off: this was cooked up with perl v5.36.0 on 2022-10-14, and that's on periodt π
π
π¦ where this page comes from
- ubuntu noble: libchart-clicker-perl 2.90-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libchart-clicker-perl 2.90-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libchart-clicker-perl 2.90-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms