| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Excel::Writer::XLSX::Chart::Scatter; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# Scatter - A class for writing Excel Scatter charts. |
|
6
|
|
|
|
|
|
|
# |
|
7
|
|
|
|
|
|
|
# Used in conjunction with Excel::Writer::XLSX::Chart. |
|
8
|
|
|
|
|
|
|
# |
|
9
|
|
|
|
|
|
|
# See formatting note in Excel::Writer::XLSX::Chart. |
|
10
|
|
|
|
|
|
|
# |
|
11
|
|
|
|
|
|
|
# Copyright 2000-2020, John McNamara, jmcnamara@cpan.org |
|
12
|
|
|
|
|
|
|
# |
|
13
|
|
|
|
|
|
|
# Documentation after __END__ |
|
14
|
|
|
|
|
|
|
# |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# perltidy with the following options: -mbl=2 -pt=0 -nola |
|
17
|
|
|
|
|
|
|
|
|
18
|
34
|
|
|
34
|
|
3004
|
use 5.008002; |
|
|
34
|
|
|
|
|
111
|
|
|
19
|
34
|
|
|
34
|
|
211
|
use strict; |
|
|
34
|
|
|
|
|
62
|
|
|
|
34
|
|
|
|
|
652
|
|
|
20
|
34
|
|
|
34
|
|
158
|
use warnings; |
|
|
34
|
|
|
|
|
62
|
|
|
|
34
|
|
|
|
|
872
|
|
|
21
|
34
|
|
|
34
|
|
156
|
use Carp; |
|
|
34
|
|
|
|
|
62
|
|
|
|
34
|
|
|
|
|
1838
|
|
|
22
|
34
|
|
|
34
|
|
193
|
use Excel::Writer::XLSX::Chart; |
|
|
34
|
|
|
|
|
60
|
|
|
|
34
|
|
|
|
|
39388
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our @ISA = qw(Excel::Writer::XLSX::Chart); |
|
25
|
|
|
|
|
|
|
our $VERSION = '1.07'; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
############################################################################### |
|
29
|
|
|
|
|
|
|
# |
|
30
|
|
|
|
|
|
|
# new() |
|
31
|
|
|
|
|
|
|
# |
|
32
|
|
|
|
|
|
|
# |
|
33
|
|
|
|
|
|
|
sub new { |
|
34
|
|
|
|
|
|
|
|
|
35
|
34
|
|
|
34
|
0
|
879
|
my $class = shift; |
|
36
|
34
|
|
|
|
|
144
|
my $self = Excel::Writer::XLSX::Chart->new( @_ ); |
|
37
|
|
|
|
|
|
|
|
|
38
|
34
|
|
100
|
|
|
157
|
$self->{_subtype} = $self->{_subtype} || 'marker_only'; |
|
39
|
34
|
|
|
|
|
71
|
$self->{_cross_between} = 'midCat'; |
|
40
|
34
|
|
|
|
|
56
|
$self->{_horiz_val_axis} = 0; |
|
41
|
34
|
|
|
|
|
64
|
$self->{_val_axis_postion} = 'b'; |
|
42
|
34
|
|
|
|
|
57
|
$self->{_smooth_allowed} = 1; |
|
43
|
34
|
|
|
|
|
60
|
$self->{_requires_category} = 1; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Set the available data label positions for this chart type. |
|
46
|
34
|
|
|
|
|
55
|
$self->{_label_position_default} = 'right'; |
|
47
|
|
|
|
|
|
|
$self->{_label_positions} = { |
|
48
|
34
|
|
|
|
|
226
|
center => 'ctr', |
|
49
|
|
|
|
|
|
|
right => 'r', |
|
50
|
|
|
|
|
|
|
left => 'l', |
|
51
|
|
|
|
|
|
|
above => 't', |
|
52
|
|
|
|
|
|
|
below => 'b', |
|
53
|
|
|
|
|
|
|
# For backward compatibility. |
|
54
|
|
|
|
|
|
|
top => 't', |
|
55
|
|
|
|
|
|
|
bottom => 'b', |
|
56
|
|
|
|
|
|
|
}; |
|
57
|
|
|
|
|
|
|
|
|
58
|
34
|
|
|
|
|
95
|
bless $self, $class; |
|
59
|
34
|
|
|
|
|
131
|
return $self; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
############################################################################### |
|
64
|
|
|
|
|
|
|
# |
|
65
|
|
|
|
|
|
|
# combine() |
|
66
|
|
|
|
|
|
|
# |
|
67
|
|
|
|
|
|
|
# Override parent method to add a warning. |
|
68
|
|
|
|
|
|
|
# |
|
69
|
|
|
|
|
|
|
sub combine { |
|
70
|
|
|
|
|
|
|
|
|
71
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
72
|
0
|
|
|
|
|
0
|
my $chart = shift; |
|
73
|
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
0
|
carp 'Combined chart not currently supported with scatter chart ' . |
|
75
|
|
|
|
|
|
|
'as the primary chart'; |
|
76
|
0
|
|
|
|
|
0
|
return; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
############################################################################## |
|
81
|
|
|
|
|
|
|
# |
|
82
|
|
|
|
|
|
|
# _write_chart_type() |
|
83
|
|
|
|
|
|
|
# |
|
84
|
|
|
|
|
|
|
# Override the virtual superclass method with a chart specific method. |
|
85
|
|
|
|
|
|
|
# |
|
86
|
|
|
|
|
|
|
sub _write_chart_type { |
|
87
|
|
|
|
|
|
|
|
|
88
|
66
|
|
|
66
|
|
126
|
my $self = shift; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# Write the c:scatterChart element. |
|
91
|
66
|
|
|
|
|
179
|
$self->_write_scatter_chart( @_ ); |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
############################################################################## |
|
96
|
|
|
|
|
|
|
# |
|
97
|
|
|
|
|
|
|
# _write_scatter_chart() |
|
98
|
|
|
|
|
|
|
# |
|
99
|
|
|
|
|
|
|
# Write the element. |
|
100
|
|
|
|
|
|
|
# |
|
101
|
|
|
|
|
|
|
sub _write_scatter_chart { |
|
102
|
|
|
|
|
|
|
|
|
103
|
66
|
|
|
66
|
|
106
|
my $self = shift; |
|
104
|
66
|
|
|
|
|
178
|
my %args = @_; |
|
105
|
|
|
|
|
|
|
|
|
106
|
66
|
|
|
|
|
114
|
my @series; |
|
107
|
66
|
100
|
|
|
|
167
|
if ( $args{primary_axes} ) { |
|
108
|
33
|
|
|
|
|
277
|
@series = $self->_get_primary_axes_series; |
|
109
|
|
|
|
|
|
|
} |
|
110
|
|
|
|
|
|
|
else { |
|
111
|
33
|
|
|
|
|
234
|
@series = $self->_get_secondary_axes_series; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
66
|
100
|
|
|
|
254
|
return unless scalar @series; |
|
115
|
|
|
|
|
|
|
|
|
116
|
34
|
|
|
|
|
77
|
my $style = 'lineMarker'; |
|
117
|
34
|
|
|
|
|
90
|
my $subtype = $self->{_subtype}; |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# Set the user defined chart subtype. |
|
120
|
|
|
|
|
|
|
|
|
121
|
34
|
100
|
|
|
|
126
|
if ($subtype eq 'marker_only') { |
|
122
|
24
|
|
|
|
|
72
|
$style = 'lineMarker'; |
|
123
|
|
|
|
|
|
|
} |
|
124
|
|
|
|
|
|
|
|
|
125
|
34
|
100
|
|
|
|
175
|
if ($subtype eq 'straight_with_markers') { |
|
126
|
3
|
|
|
|
|
7
|
$style = 'lineMarker'; |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
|
|
129
|
34
|
100
|
|
|
|
121
|
if ($subtype eq 'straight') { |
|
130
|
3
|
|
|
|
|
5
|
$style = 'lineMarker'; |
|
131
|
3
|
|
|
|
|
14
|
$self->{_default_marker} = { type => 'none' }; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
34
|
100
|
|
|
|
116
|
if ($subtype eq 'smooth_with_markers') { |
|
135
|
2
|
|
|
|
|
4
|
$style = 'smoothMarker'; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
34
|
100
|
|
|
|
113
|
if ($subtype eq 'smooth') { |
|
139
|
2
|
|
|
|
|
4
|
$style = 'smoothMarker'; |
|
140
|
2
|
|
|
|
|
8
|
$self->{_default_marker} = { type => 'none' }; |
|
141
|
|
|
|
|
|
|
} |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# Add default formatting to the series data. |
|
144
|
34
|
|
|
|
|
153
|
$self->_modify_series_formatting(); |
|
145
|
|
|
|
|
|
|
|
|
146
|
34
|
|
|
|
|
137
|
$self->xml_start_tag( 'c:scatterChart' ); |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# Write the c:scatterStyle element. |
|
149
|
34
|
|
|
|
|
139
|
$self->_write_scatter_style( $style ); |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# Write the series elements. |
|
152
|
34
|
|
|
|
|
157
|
$self->_write_ser( $_ ) for @series; |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
# Write the c:axId elements |
|
155
|
34
|
|
|
|
|
342
|
$self->_write_axis_ids( %args ); |
|
156
|
|
|
|
|
|
|
|
|
157
|
34
|
|
|
|
|
131
|
$self->xml_end_tag( 'c:scatterChart' ); |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
############################################################################## |
|
162
|
|
|
|
|
|
|
# |
|
163
|
|
|
|
|
|
|
# _write_ser() |
|
164
|
|
|
|
|
|
|
# |
|
165
|
|
|
|
|
|
|
# Over-ridden to write c:xVal/c:yVal instead of c:cat/c:val elements. |
|
166
|
|
|
|
|
|
|
# |
|
167
|
|
|
|
|
|
|
# Write the element. |
|
168
|
|
|
|
|
|
|
# |
|
169
|
|
|
|
|
|
|
sub _write_ser { |
|
170
|
|
|
|
|
|
|
|
|
171
|
62
|
|
|
62
|
|
121
|
my $self = shift; |
|
172
|
62
|
|
|
|
|
133
|
my $series = shift; |
|
173
|
62
|
|
|
|
|
144
|
my $index = $self->{_series_index}++; |
|
174
|
|
|
|
|
|
|
|
|
175
|
62
|
|
|
|
|
220
|
$self->xml_start_tag( 'c:ser' ); |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# Write the c:idx element. |
|
178
|
62
|
|
|
|
|
350
|
$self->_write_idx( $index ); |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
# Write the c:order element. |
|
181
|
62
|
|
|
|
|
271
|
$self->_write_order( $index ); |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
# Write the series name. |
|
184
|
62
|
|
|
|
|
288
|
$self->_write_series_name( $series ); |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
# Write the c:spPr element. |
|
187
|
62
|
|
|
|
|
325
|
$self->_write_sp_pr( $series ); |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
# Write the c:marker element. |
|
190
|
62
|
|
|
|
|
348
|
$self->_write_marker( $series->{_marker} ); |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
# Write the c:dPt element. |
|
193
|
62
|
|
|
|
|
286
|
$self->_write_d_pt( $series->{_points} ); |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# Write the c:dLbls element. |
|
196
|
62
|
|
|
|
|
319
|
$self->_write_d_lbls( $series->{_labels} ); |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# Write the c:trendline element. |
|
199
|
62
|
|
|
|
|
331
|
$self->_write_trendline( $series->{_trendline} ); |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# Write the c:errBars element. |
|
202
|
62
|
|
|
|
|
360
|
$self->_write_error_bars( $series->{_error_bars} ); |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
# Write the c:xVal element. |
|
205
|
62
|
|
|
|
|
199
|
$self->_write_x_val( $series ); |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# Write the c:yVal element. |
|
208
|
62
|
|
|
|
|
211
|
$self->_write_y_val( $series ); |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# Write the c:smooth element. |
|
211
|
62
|
100
|
100
|
|
|
352
|
if ( $self->{_subtype} =~ /smooth/ && !defined $series->{_smooth} ) { |
|
212
|
|
|
|
|
|
|
# Default is on for smooth scatter charts. |
|
213
|
6
|
|
|
|
|
43
|
$self->_write_c_smooth( 1 ); |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
else { |
|
216
|
56
|
|
|
|
|
338
|
$self->_write_c_smooth( $series->{_smooth} ); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
62
|
|
|
|
|
170
|
$self->xml_end_tag( 'c:ser' ); |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
############################################################################## |
|
224
|
|
|
|
|
|
|
# |
|
225
|
|
|
|
|
|
|
# _write_plot_area() |
|
226
|
|
|
|
|
|
|
# |
|
227
|
|
|
|
|
|
|
# Over-ridden to have 2 valAx elements for scatter charts instead of |
|
228
|
|
|
|
|
|
|
# catAx/valAx. |
|
229
|
|
|
|
|
|
|
# |
|
230
|
|
|
|
|
|
|
# Write the element. |
|
231
|
|
|
|
|
|
|
# |
|
232
|
|
|
|
|
|
|
sub _write_plot_area { |
|
233
|
|
|
|
|
|
|
|
|
234
|
31
|
|
|
31
|
|
71
|
my $self = shift; |
|
235
|
|
|
|
|
|
|
|
|
236
|
31
|
|
|
|
|
118
|
$self->xml_start_tag( 'c:plotArea' ); |
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# Write the c:layout element. |
|
239
|
31
|
|
|
|
|
379
|
$self->_write_layout( $self->{_plotarea}->{_layout}, 'plot' ); |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# Write the subclass chart type elements for primary and secondary axes. |
|
242
|
31
|
|
|
|
|
160
|
$self->_write_chart_type( primary_axes => 1 ); |
|
243
|
31
|
|
|
|
|
125
|
$self->_write_chart_type( primary_axes => 0 ); |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
# Write c:catAx and c:valAx elements for series using primary axes. |
|
246
|
|
|
|
|
|
|
$self->_write_cat_val_axis( |
|
247
|
|
|
|
|
|
|
x_axis => $self->{_x_axis}, |
|
248
|
|
|
|
|
|
|
y_axis => $self->{_y_axis}, |
|
249
|
|
|
|
|
|
|
axis_ids => $self->{_axis_ids}, |
|
250
|
31
|
|
|
|
|
292
|
position => 'b', |
|
251
|
|
|
|
|
|
|
); |
|
252
|
|
|
|
|
|
|
|
|
253
|
31
|
|
|
|
|
85
|
my $tmp = $self->{_horiz_val_axis}; |
|
254
|
31
|
|
|
|
|
79
|
$self->{_horiz_val_axis} = 1; |
|
255
|
|
|
|
|
|
|
$self->_write_val_axis( |
|
256
|
|
|
|
|
|
|
x_axis => $self->{_x_axis}, |
|
257
|
|
|
|
|
|
|
y_axis => $self->{_y_axis}, |
|
258
|
|
|
|
|
|
|
axis_ids => $self->{_axis_ids}, |
|
259
|
31
|
|
|
|
|
330
|
position => 'l', |
|
260
|
|
|
|
|
|
|
); |
|
261
|
31
|
|
|
|
|
81
|
$self->{_horiz_val_axis} = $tmp; |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
# Write c:valAx and c:catAx elements for series using secondary axes. |
|
264
|
|
|
|
|
|
|
$self->_write_cat_val_axis( |
|
265
|
|
|
|
|
|
|
x_axis => $self->{_x2_axis}, |
|
266
|
|
|
|
|
|
|
y_axis => $self->{_y2_axis}, |
|
267
|
|
|
|
|
|
|
axis_ids => $self->{_axis2_ids}, |
|
268
|
31
|
|
|
|
|
202
|
position => 'b', |
|
269
|
|
|
|
|
|
|
); |
|
270
|
31
|
|
|
|
|
74
|
$self->{_horiz_val_axis} = 1; |
|
271
|
|
|
|
|
|
|
$self->_write_val_axis( |
|
272
|
|
|
|
|
|
|
x_axis => $self->{_x2_axis}, |
|
273
|
|
|
|
|
|
|
y_axis => $self->{_y2_axis}, |
|
274
|
|
|
|
|
|
|
axis_ids => $self->{_axis2_ids}, |
|
275
|
31
|
|
|
|
|
178
|
position => 'l', |
|
276
|
|
|
|
|
|
|
); |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
# Write the c:spPr element for the plotarea formatting. |
|
279
|
31
|
|
|
|
|
125
|
$self->_write_sp_pr( $self->{_plotarea} ); |
|
280
|
|
|
|
|
|
|
|
|
281
|
31
|
|
|
|
|
112
|
$self->xml_end_tag( 'c:plotArea' ); |
|
282
|
|
|
|
|
|
|
} |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
############################################################################## |
|
286
|
|
|
|
|
|
|
# |
|
287
|
|
|
|
|
|
|
# _write_x_val() |
|
288
|
|
|
|
|
|
|
# |
|
289
|
|
|
|
|
|
|
# Write the element. |
|
290
|
|
|
|
|
|
|
# |
|
291
|
|
|
|
|
|
|
sub _write_x_val { |
|
292
|
|
|
|
|
|
|
|
|
293
|
62
|
|
|
62
|
|
107
|
my $self = shift; |
|
294
|
62
|
|
|
|
|
101
|
my $series = shift; |
|
295
|
62
|
|
|
|
|
133
|
my $formula = $series->{_categories}; |
|
296
|
62
|
|
|
|
|
106
|
my $data_id = $series->{_cat_data_id}; |
|
297
|
62
|
|
|
|
|
135
|
my $data = $self->{_formula_data}->[$data_id]; |
|
298
|
|
|
|
|
|
|
|
|
299
|
62
|
|
|
|
|
231
|
$self->xml_start_tag( 'c:xVal' ); |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# Check the type of cached data. |
|
302
|
62
|
|
|
|
|
302
|
my $type = $self->_get_data_type( $data ); |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
# TODO. Can a scatter plot have non-numeric data. |
|
305
|
|
|
|
|
|
|
|
|
306
|
62
|
100
|
|
|
|
228
|
if ( $type eq 'str' ) { |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
# Write the c:numRef element. |
|
309
|
2
|
|
|
|
|
8
|
$self->_write_str_ref( $formula, $data, $type ); |
|
310
|
|
|
|
|
|
|
} |
|
311
|
|
|
|
|
|
|
else { |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
# Write the c:numRef element. |
|
314
|
60
|
|
|
|
|
317
|
$self->_write_num_ref( $formula, $data, $type ); |
|
315
|
|
|
|
|
|
|
} |
|
316
|
|
|
|
|
|
|
|
|
317
|
62
|
|
|
|
|
190
|
$self->xml_end_tag( 'c:xVal' ); |
|
318
|
|
|
|
|
|
|
} |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
############################################################################## |
|
322
|
|
|
|
|
|
|
# |
|
323
|
|
|
|
|
|
|
# _write_y_val() |
|
324
|
|
|
|
|
|
|
# |
|
325
|
|
|
|
|
|
|
# Write the element. |
|
326
|
|
|
|
|
|
|
# |
|
327
|
|
|
|
|
|
|
sub _write_y_val { |
|
328
|
|
|
|
|
|
|
|
|
329
|
62
|
|
|
62
|
|
130
|
my $self = shift; |
|
330
|
62
|
|
|
|
|
105
|
my $series = shift; |
|
331
|
62
|
|
|
|
|
154
|
my $formula = $series->{_values}; |
|
332
|
62
|
|
|
|
|
125
|
my $data_id = $series->{_val_data_id}; |
|
333
|
62
|
|
|
|
|
137
|
my $data = $self->{_formula_data}->[$data_id]; |
|
334
|
|
|
|
|
|
|
|
|
335
|
62
|
|
|
|
|
212
|
$self->xml_start_tag( 'c:yVal' ); |
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
# Unlike Cat axes data should only be numeric. |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
# Write the c:numRef element. |
|
340
|
62
|
|
|
|
|
217
|
$self->_write_num_ref( $formula, $data, 'num' ); |
|
341
|
|
|
|
|
|
|
|
|
342
|
62
|
|
|
|
|
203
|
$self->xml_end_tag( 'c:yVal' ); |
|
343
|
|
|
|
|
|
|
} |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
############################################################################## |
|
347
|
|
|
|
|
|
|
# |
|
348
|
|
|
|
|
|
|
# _write_scatter_style() |
|
349
|
|
|
|
|
|
|
# |
|
350
|
|
|
|
|
|
|
# Write the element. |
|
351
|
|
|
|
|
|
|
# |
|
352
|
|
|
|
|
|
|
sub _write_scatter_style { |
|
353
|
|
|
|
|
|
|
|
|
354
|
34
|
|
|
34
|
|
89
|
my $self = shift; |
|
355
|
34
|
|
|
|
|
73
|
my $val = shift; |
|
356
|
|
|
|
|
|
|
|
|
357
|
34
|
|
|
|
|
113
|
my @attributes = ( 'val' => $val ); |
|
358
|
|
|
|
|
|
|
|
|
359
|
34
|
|
|
|
|
154
|
$self->xml_empty_tag( 'c:scatterStyle', @attributes ); |
|
360
|
|
|
|
|
|
|
} |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
############################################################################## |
|
364
|
|
|
|
|
|
|
# |
|
365
|
|
|
|
|
|
|
# _modify_series_formatting() |
|
366
|
|
|
|
|
|
|
# |
|
367
|
|
|
|
|
|
|
# Add default formatting to the series data unless it has already been |
|
368
|
|
|
|
|
|
|
# specified by the user. |
|
369
|
|
|
|
|
|
|
# |
|
370
|
|
|
|
|
|
|
sub _modify_series_formatting { |
|
371
|
|
|
|
|
|
|
|
|
372
|
34
|
|
|
34
|
|
65
|
my $self = shift; |
|
373
|
34
|
|
|
|
|
90
|
my $subtype = $self->{_subtype}; |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
# The default scatter style "markers only" requires a line type. |
|
376
|
34
|
100
|
|
|
|
118
|
if ( $subtype eq 'marker_only' ) { |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
# Go through each series and define default values. |
|
379
|
24
|
|
|
|
|
47
|
for my $series ( @{ $self->{_series} } ) { |
|
|
24
|
|
|
|
|
66
|
|
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
# Set a line type unless there is already a user defined type. |
|
382
|
44
|
100
|
|
|
|
149
|
if ( !$series->{_line}->{_defined} ) { |
|
383
|
|
|
|
|
|
|
$series->{_line} = { |
|
384
|
42
|
|
|
|
|
221
|
width => 2.25, |
|
385
|
|
|
|
|
|
|
none => 1, |
|
386
|
|
|
|
|
|
|
_defined => 1, |
|
387
|
|
|
|
|
|
|
}; |
|
388
|
|
|
|
|
|
|
} |
|
389
|
|
|
|
|
|
|
} |
|
390
|
|
|
|
|
|
|
} |
|
391
|
|
|
|
|
|
|
} |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
############################################################################## |
|
395
|
|
|
|
|
|
|
# |
|
396
|
|
|
|
|
|
|
# _write_d_pt_point() |
|
397
|
|
|
|
|
|
|
# |
|
398
|
|
|
|
|
|
|
# Write an individual element. Override the parent method to add |
|
399
|
|
|
|
|
|
|
# markers. |
|
400
|
|
|
|
|
|
|
# |
|
401
|
|
|
|
|
|
|
sub _write_d_pt_point { |
|
402
|
|
|
|
|
|
|
|
|
403
|
3
|
|
|
3
|
|
6
|
my $self = shift; |
|
404
|
3
|
|
|
|
|
5
|
my $index = shift; |
|
405
|
3
|
|
|
|
|
4
|
my $point = shift; |
|
406
|
|
|
|
|
|
|
|
|
407
|
3
|
|
|
|
|
8
|
$self->xml_start_tag( 'c:dPt' ); |
|
408
|
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
# Write the c:idx element. |
|
410
|
3
|
|
|
|
|
11
|
$self->_write_idx( $index ); |
|
411
|
|
|
|
|
|
|
|
|
412
|
3
|
|
|
|
|
10
|
$self->xml_start_tag( 'c:marker' ); |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
# Write the c:spPr element. |
|
415
|
3
|
|
|
|
|
11
|
$self->_write_sp_pr( $point ); |
|
416
|
|
|
|
|
|
|
|
|
417
|
3
|
|
|
|
|
10
|
$self->xml_end_tag( 'c:marker' ); |
|
418
|
|
|
|
|
|
|
|
|
419
|
3
|
|
|
|
|
7
|
$self->xml_end_tag( 'c:dPt' ); |
|
420
|
|
|
|
|
|
|
} |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
1; |
|
424
|
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
__END__ |