| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Chart::Points; |
|
22
|
|
|
|
|
|
|
|
|
23
|
3
|
|
|
3
|
|
109
|
use Chart::Base 2.3; |
|
|
3
|
|
|
|
|
528
|
|
|
|
3
|
|
|
|
|
95
|
|
|
24
|
3
|
|
|
3
|
|
103
|
use GD; |
|
|
3
|
|
|
|
|
26
|
|
|
|
3
|
|
|
|
|
57
|
|
|
25
|
3
|
|
|
3
|
|
73
|
use Carp; |
|
|
3
|
|
|
|
|
28
|
|
|
|
3
|
|
|
|
|
52
|
|
|
26
|
3
|
|
|
3
|
|
46
|
use strict; |
|
|
3
|
|
|
|
|
27
|
|
|
|
3
|
|
|
|
|
42
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
@Chart::Points::ISA = qw(Chart::Base); |
|
29
|
|
|
|
|
|
|
$Chart::Points::VERSION = '2.3'; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _draw_data { |
|
43
|
3
|
|
|
3
|
|
239
|
my $self = shift; |
|
44
|
3
|
|
|
|
|
50
|
my $data = $self->{'dataref'}; |
|
45
|
3
|
|
|
|
|
44
|
my $misccolor = $self->_color_role_to_index('misc'); |
|
46
|
3
|
|
|
|
|
30
|
my ($x1, $x2, $x3, $y1, $y2, $y3, $mod); |
|
47
|
3
|
|
|
|
|
29
|
my ($width, $height, $delta, $map, $delta_num, $zero_offset); |
|
48
|
3
|
|
|
|
|
29
|
my ($i, $j, $color, $brush); |
|
49
|
3
|
|
|
|
|
28
|
my $diff; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
3
|
50
|
|
|
|
38
|
if ($self->{'imagemap'} =~ /^true$/i) { |
|
53
|
0
|
|
|
|
|
0
|
$self->{'imagemap_data'} = []; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
3
|
|
|
|
|
34
|
$width = $self->{'curr_x_max'} - $self->{'curr_x_min'}; |
|
59
|
3
|
|
|
|
|
33
|
$height = $self->{'curr_y_max'} - $self->{'curr_y_min'}; |
|
60
|
3
|
50
|
|
|
|
41
|
$delta = $width / ( $self->{'num_datapoints'} > 0 ? $self->{'num_datapoints'} : 1); |
|
61
|
3
|
|
|
|
|
33
|
$diff = ($self->{'max_val'} - $self->{'min_val'}); |
|
62
|
3
|
50
|
|
|
|
34
|
$diff = 1 if $diff == 0; |
|
63
|
3
|
|
|
|
|
30
|
$map = $height / $diff; |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
3
|
50
|
|
|
|
39
|
if ($self->{'xy_plot'} =~ /^true$/i ) { |
|
67
|
0
|
|
|
|
|
0
|
$diff = ($self->{'x_max_val'} - $self->{'x_min_val'}); |
|
68
|
0
|
0
|
|
|
|
0
|
$diff = 1 if $diff == 0; |
|
69
|
0
|
|
|
|
|
0
|
$delta_num = $width / $diff; |
|
70
|
|
|
|
|
|
|
|
|
71
|
0
|
0
|
0
|
|
|
0
|
if ($self->{'x_min_val'} <= 0 && $self->{'x_max_val'} >= 0) { |
|
|
|
0
|
0
|
|
|
|
|
|
72
|
0
|
|
|
|
|
0
|
$zero_offset = abs($self->{'x_min_val'}) * abs($delta_num); |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
elsif ($self->{'x_min_val'} > 0 || $self->{'x_max_val'} < 0) { |
|
75
|
0
|
|
|
|
|
0
|
$zero_offset = -$self->{'x_min_val'} * $delta_num; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
else { |
|
78
|
0
|
|
|
|
|
0
|
$zero_offset = 0; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
3
|
50
|
|
|
|
39
|
if ($self->{'xy_plot'} =~ /^false$/i ) { |
|
84
|
3
|
|
|
|
|
35
|
$x1 = $self->{'curr_x_min'} + ($delta / 2); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
else { |
|
87
|
0
|
|
|
|
|
0
|
$x1 = $self->{'curr_x_min'}; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
3
|
100
|
|
|
|
39
|
if ($self->{'min_val'} >= 0) { |
|
|
|
50
|
|
|
|
|
|
|
90
|
2
|
|
|
|
|
286
|
$y1 = $self->{'curr_y_max'}; |
|
91
|
2
|
|
|
|
|
19
|
$mod = $self->{'min_val'}; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
elsif ($self->{'max_val'} <= 0) { |
|
94
|
0
|
|
|
|
|
0
|
$y1 = $self->{'curr_y_min'}; |
|
95
|
0
|
|
|
|
|
0
|
$mod = $self->{'max_val'}; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
else { |
|
98
|
1
|
|
|
|
|
12
|
$y1 = $self->{'curr_y_min'} + ($map * $self->{'max_val'}); |
|
99
|
1
|
|
|
|
|
10
|
$mod = 0; |
|
100
|
1
|
|
|
|
|
33
|
$self->{'gd_obj'}->line ($self->{'curr_x_min'}, $y1, |
|
101
|
|
|
|
|
|
|
$self->{'curr_x_max'}, $y1, |
|
102
|
|
|
|
|
|
|
$misccolor); |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
|
106
|
3
|
|
|
|
|
36
|
for $i (1..$self->{'num_datasets'}) { |
|
107
|
|
|
|
|
|
|
|
|
108
|
5
|
|
|
|
|
74
|
$color = $self->_color_role_to_index('dataset'.($i-1)); |
|
109
|
5
|
|
|
|
|
353
|
$brush = $self->_prepare_brush ($color); |
|
110
|
5
|
|
|
|
|
97
|
$self->{'gd_obj'}->setBrush ($brush); |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
|
113
|
5
|
|
|
|
|
55
|
for $j (0..$self->{'num_datapoints'}) { |
|
114
|
|
|
|
|
|
|
|
|
115
|
3846
|
100
|
|
|
|
52509
|
if (defined ($data->[$i][$j])) { |
|
116
|
3832
|
50
|
|
|
|
56445
|
if ($self->{'xy_plot'} =~ /^true$/i ) { |
|
117
|
0
|
|
|
|
|
0
|
$x2 = $x1 + $delta_num * $data->[0][$j] + $zero_offset; |
|
118
|
0
|
|
|
|
|
0
|
$x3 = $x2 ; |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
else { |
|
121
|
3832
|
|
|
|
|
42703
|
$x2 = $x1 + ($delta * $j); |
|
122
|
3832
|
|
|
|
|
41601
|
$x3 = $x2; |
|
123
|
|
|
|
|
|
|
} |
|
124
|
3832
|
|
|
|
|
49569
|
$y2 = $y1 - (($data->[$i][$j] - $mod) * $map); |
|
125
|
3832
|
|
|
|
|
44851
|
$y3 = $y2; |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
|
128
|
3832
|
50
|
33
|
|
|
56305
|
if ($data->[$i][$j] <= $self->{'max_val'} && $data->[$i][$j] >= $self->{'min_val'}) { |
|
129
|
3832
|
|
|
|
|
49092
|
$self->{'gd_obj'}->line($x2, $y2, $x3, $y3, gdBrushed); |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
|
133
|
3832
|
50
|
|
|
|
54939
|
if ($self->{'imagemap'} =~ /^true$/i) { |
|
134
|
0
|
|
|
|
|
0
|
$self->{'imagemap_data'}->[$i][$j] = [ $x2, $y2 ]; |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
|
141
|
3
|
|
|
|
|
401
|
$self->{'gd_obj'}->rectangle ($self->{'curr_x_min'}, |
|
142
|
|
|
|
|
|
|
$self->{'curr_y_min'}, |
|
143
|
|
|
|
|
|
|
$self->{'curr_x_max'}, |
|
144
|
|
|
|
|
|
|
$self->{'curr_y_max'}, |
|
145
|
|
|
|
|
|
|
$misccolor); |
|
146
|
3
|
|
|
|
|
135
|
return; |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub _prepare_brush { |
|
153
|
9
|
|
|
9
|
|
79
|
my $self = shift; |
|
154
|
9
|
|
|
|
|
83
|
my $color = shift; |
|
155
|
9
|
|
|
|
|
91
|
my $radius = $self->{'pt_size'}/2; |
|
156
|
9
|
|
|
|
|
79
|
my (@rgb, $brush, $white, $newcolor); |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
|
159
|
9
|
|
|
|
|
289
|
@rgb = $self->{'gd_obj'}->rgb($color); |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
|
162
|
9
|
|
|
|
|
185
|
$brush = GD::Image->new ($radius*2, $radius*2); |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
9
|
|
|
|
|
1001
|
$white = $brush->colorAllocate (255,255,255); |
|
166
|
9
|
|
|
|
|
142
|
$newcolor = $brush->colorAllocate (@rgb); |
|
167
|
9
|
|
|
|
|
102
|
$brush->transparent ($white); |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
|
170
|
9
|
|
|
|
|
715
|
$brush->arc ($radius-1, $radius-1, $radius, $radius, 0, 360, $newcolor); |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
|
173
|
9
|
|
|
|
|
146
|
$brush->fill ($radius-1, $radius-1, $newcolor); |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
|
176
|
9
|
|
|
|
|
108
|
return $brush; |
|
177
|
|
|
|
|
|
|
} |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
|
181
|
|
|
|
|
|
|
|