| Chart-Clicker documentation | Contained in the Chart-Clicker distribution. |
Chart::Clicker::Data::Series::Size - Chart data with additional attributes for Size charts
Chart::Clicker::Data::Series::Size is an extension of the Series class that provides storage for a third variable called the size. This is useful for the Bubble renderer.
use Chart::Clicker::Data::Series::Size;
my $series = Chart::Clicker::Data::Series::Size->new({
keys => \@keys,
values => \@values,
sizes => \@sized
});
Set/Get the sizes for this series.
Gets the largest value from this Series' sizes.
Gets the smallest value from this Series' sizes.
Creates a new, empty Series::Size
Adds a size to this series.
Get a size by it's index.
Gets the count of sizes in this series.
Cory G Watson <gphat@cpan.org>
You can redistribute and/or modify this code under the same terms as Perl itself.
1;
| Chart-Clicker documentation | Contained in the Chart-Clicker distribution. |
package Chart::Clicker::Data::Series::Size; use Moose; extends 'Chart::Clicker::Data::Series'; use List::Util qw(min max); has 'sizes' => ( traits => [ 'Array' ], is => 'rw', isa => 'ArrayRef', default => sub { [] }, handles => { 'add_to_sizes' => 'push', 'size_count' => 'count', 'get_size' => 'get' } ); has max_size => ( is => 'ro', isa => 'Num', lazy_build => 1 ); has min_size => ( is => 'ro', isa => 'Num', lazy_build => 1 ); sub _build_max_size { my ($self) = @_; return max(@{ $self->sizes }); } sub _build_min_size { my ($self) = @_; return min(@{ $self->sizes }); } __PACKAGE__->meta->make_immutable; no Moose; 1; __END__