Chart::Clicker::Renderer::Bubble - Bubble render


Chart-Clicker documentation Contained in the Chart-Clicker distribution.

Index


Code Index:

NAME

Top

Chart::Clicker::Renderer::Bubble - Bubble render

DESCRIPTION

Top

Chart::Clicker::Renderer::Bubble is a subclass of the Point renderer where the points' radiuses are determined by the size value of a Series::Size.

Note: This renderer requires you to use a Chart::Clicker::Data::Series::Size.

SYNOPSIS

Top

  my $pr = Chart::Clicker::Renderer::Bubble->new({
    shape => Chart::Clicker::Shape::Arc->new({
        angle1 => 0,
        angle2 => 180,
    })
  });

METHODS

Top

new

Create a new Bubble renderer

draw_point

Called for each point. Implemented as a separate method so that subclasses such as Bubble may override the drawing.

AUTHOR

Top

Cory G Watson <gphat@cpan.org>

SEE ALSO

Top

perl(1)

LICENSE

Top

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


Chart-Clicker documentation Contained in the Chart-Clicker distribution.

package Chart::Clicker::Renderer::Bubble;
use Moose;

extends 'Chart::Clicker::Renderer::Point';

override('draw_point', sub {
    my ($self, $x, $y, $series, $count) = @_;

    my $shape = $self->shape->scale($series->get_size($count));
    $shape->origin(Geometry::Primitive::Point->new(x => $x, y => $y));
    $self->path->add_primitive($shape);
});

__PACKAGE__->meta->make_immutable;

no Moose;

1;

__END__