File Coverage

blib/lib/Chart/Clicker/Renderer/Bubble.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Chart::Clicker::Renderer::Bubble;
2             $Chart::Clicker::Renderer::Bubble::VERSION = '2.90';
3 1     1   59945 use Moose;
  1         368721  
  1         6  
4              
5             # ABSTRACT: Bubble render
6              
7             extends 'Chart::Clicker::Renderer::Point';
8              
9              
10             override('draw_point', sub {
11             my ($self, $x, $y, $series, $count) = @_;
12              
13             my $shape = $self->shape->scale($series->get_size($count));
14             $shape->origin(Geometry::Primitive::Point->new(x => $x, y => $y));
15             $self->path->add_primitive($shape);
16             });
17              
18             __PACKAGE__->meta->make_immutable;
19              
20 1     1   5740 no Moose;
  1         2  
  1         6  
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =head1 NAME
29              
30             Chart::Clicker::Renderer::Bubble - Bubble render
31              
32             =head1 VERSION
33              
34             version 2.90
35              
36             =head1 SYNOPSIS
37              
38             my $pr = Chart::Clicker::Renderer::Bubble->new({
39             shape => Geometry::Primitive::Circle->new({
40             radius => 3
41             })
42             });
43              
44             =head1 DESCRIPTION
45              
46             Chart::Clicker::Renderer::Bubble is a subclass of the Point renderer where
47             the points' radiuses are determined by the size value of a Series::Size.
48              
49             Note: B<This renderer requires you to use a
50             Chart::Clicker::Data::Series::Size>.
51              
52             =for HTML <p><img src="http://gphat.github.com/chart-clicker/static/images/examples/bubble.png" width="500" height="250" alt="Bubble Chart" /></p>
53              
54             =head1 METHODS
55              
56             =head2 draw_point
57              
58             Called for each point. Implemented as a separate method so that subclasses
59             such as Bubble may override the drawing.
60              
61             =head1 AUTHOR
62              
63             Cory G Watson <gphat@cpan.org>
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             This software is copyright (c) 2016 by Cory G Watson.
68              
69             This is free software; you can redistribute it and/or modify it under
70             the same terms as the Perl 5 programming language system itself.
71              
72             =cut