line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Chart::Plot::Canvas::Tagged; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
28469
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw(Chart::Plot::Tagged Chart::Plot::Canvas); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2922
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _createData { |
10
|
|
|
|
|
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
$self->SUPER::_createData(); |
12
|
|
|
|
|
|
|
$self->_createTag(); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _createTag { |
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
foreach my $dataSetLabel (keys %{$self->{_data}}) { |
19
|
|
|
|
|
|
|
next unless (exists $self->{_tag}->{$dataSetLabel}); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# get color |
22
|
|
|
|
|
|
|
my $color = 'black'; |
23
|
|
|
|
|
|
|
if ( $self->{'_dataStyle'}->{$dataSetLabel} =~ /((red)|(blue)|(green))/i ) { |
24
|
|
|
|
|
|
|
$color = $1; |
25
|
|
|
|
|
|
|
$color =~ tr/A-Z/a-z/; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $num = @{ $self->{'_data'}->{$dataSetLabel} }; |
29
|
|
|
|
|
|
|
my $prevpx = 0; |
30
|
|
|
|
|
|
|
for (my $i = 0; $i < $num/2; $i ++) { |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# get next point |
33
|
|
|
|
|
|
|
my ($px, $py) = $self->_data2pxl ( |
34
|
|
|
|
|
|
|
$self->{_data}->{$dataSetLabel}[2*$i], |
35
|
|
|
|
|
|
|
$self->{_data}->{$dataSetLabel}[2*$i+1] |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
if ($px != $prevpx) { |
39
|
|
|
|
|
|
|
foreach (reverse split//, $self->{_tag}->{$dataSetLabel}[$i]) { |
40
|
|
|
|
|
|
|
$self->{'_cv'}->createText($px-5, $py, |
41
|
|
|
|
|
|
|
-anchor => 's', |
42
|
|
|
|
|
|
|
-font => $self->{_TinyFont}, |
43
|
|
|
|
|
|
|
-text => $_, |
44
|
|
|
|
|
|
|
-fill => $color |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
$py -= 9; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
$prevpx = $px; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |