File Coverage

blib/lib/SVG/Graph/Glyph/scatter.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 17 17 100.0


line stmt bran cond sub pod time code
1             package SVG::Graph::Glyph::scatter;
2              
3 1     1   6 use base SVG::Graph::Glyph;
  1         1  
  1         649  
4 1     1   6 use strict;
  1         2  
  1         213  
5              
6             =head2 draw
7              
8             Title : draw
9             Usage :
10             Function:
11             Example :
12             Returns :
13             Args :
14              
15              
16             =cut
17              
18             sub draw{
19 1     1 1 2 my ($self,@args) = @_;
20              
21 1         6 my $id = 'n'.sprintf("%07d",int(rand(9999999)));
22 1         4 my $group = $self->svg->group(id=>"scatter$id");
23              
24 1         62 foreach my $datum($self->group->data){
25 20         1149 my $cx = (($datum->x - $self->group->xmin) * $self->xscale) + $self->xoffset;
26 20         59 my $cy = (($self->xsize - ($datum->y - $self->group->ymin) * $self->yscale)) + $self->yoffset;
27              
28 20         70 $group->circle(cx=>$cx,cy=>$cy,r=>3,style=>{$self->_style});
29             }
30             }
31              
32             1;