| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Excel::Writer::XLSX::Chart::Line; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# Line - A class for writing Excel Line 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-2019, 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
|
86
|
|
|
86
|
|
7309
|
use 5.008002; |
|
|
86
|
|
|
|
|
346
|
|
|
19
|
86
|
|
|
86
|
|
473
|
use strict; |
|
|
86
|
|
|
|
|
165
|
|
|
|
86
|
|
|
|
|
1720
|
|
|
20
|
86
|
|
|
86
|
|
403
|
use warnings; |
|
|
86
|
|
|
|
|
182
|
|
|
|
86
|
|
|
|
|
2333
|
|
|
21
|
86
|
|
|
86
|
|
456
|
use Carp; |
|
|
86
|
|
|
|
|
182
|
|
|
|
86
|
|
|
|
|
5707
|
|
|
22
|
86
|
|
|
86
|
|
610
|
use Excel::Writer::XLSX::Chart; |
|
|
86
|
|
|
|
|
190
|
|
|
|
86
|
|
|
|
|
40803
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our @ISA = qw(Excel::Writer::XLSX::Chart); |
|
25
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
############################################################################### |
|
29
|
|
|
|
|
|
|
# |
|
30
|
|
|
|
|
|
|
# new() |
|
31
|
|
|
|
|
|
|
# |
|
32
|
|
|
|
|
|
|
# |
|
33
|
|
|
|
|
|
|
sub new { |
|
34
|
|
|
|
|
|
|
|
|
35
|
89
|
|
|
89
|
0
|
1887
|
my $class = shift; |
|
36
|
89
|
|
|
|
|
392
|
my $self = Excel::Writer::XLSX::Chart->new( @_ ); |
|
37
|
|
|
|
|
|
|
|
|
38
|
89
|
|
|
|
|
264
|
$self->{_default_marker} = { type => 'none' }; |
|
39
|
89
|
|
|
|
|
218
|
$self->{_smooth_allowed} = 1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Set the available data label positions for this chart type. |
|
42
|
89
|
|
|
|
|
170
|
$self->{_label_position_default} = 'right'; |
|
43
|
|
|
|
|
|
|
$self->{_label_positions} = { |
|
44
|
89
|
|
|
|
|
548
|
center => 'ctr', |
|
45
|
|
|
|
|
|
|
right => 'r', |
|
46
|
|
|
|
|
|
|
left => 'l', |
|
47
|
|
|
|
|
|
|
above => 't', |
|
48
|
|
|
|
|
|
|
below => 'b', |
|
49
|
|
|
|
|
|
|
# For backward compatibility. |
|
50
|
|
|
|
|
|
|
top => 't', |
|
51
|
|
|
|
|
|
|
bottom => 'b', |
|
52
|
|
|
|
|
|
|
}; |
|
53
|
|
|
|
|
|
|
|
|
54
|
89
|
|
|
|
|
241
|
bless $self, $class; |
|
55
|
89
|
|
|
|
|
325
|
return $self; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
############################################################################## |
|
60
|
|
|
|
|
|
|
# |
|
61
|
|
|
|
|
|
|
# _write_chart_type() |
|
62
|
|
|
|
|
|
|
# |
|
63
|
|
|
|
|
|
|
# Override the virtual superclass method with a chart specific method. |
|
64
|
|
|
|
|
|
|
# |
|
65
|
|
|
|
|
|
|
sub _write_chart_type { |
|
66
|
|
|
|
|
|
|
|
|
67
|
174
|
|
|
174
|
|
371
|
my $self = shift; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Write the c:lineChart element. |
|
70
|
174
|
|
|
|
|
508
|
$self->_write_line_chart( @_ ); |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
############################################################################## |
|
75
|
|
|
|
|
|
|
# |
|
76
|
|
|
|
|
|
|
# _write_line_chart() |
|
77
|
|
|
|
|
|
|
# |
|
78
|
|
|
|
|
|
|
# Write the element. |
|
79
|
|
|
|
|
|
|
# |
|
80
|
|
|
|
|
|
|
sub _write_line_chart { |
|
81
|
|
|
|
|
|
|
|
|
82
|
174
|
|
|
174
|
|
373
|
my $self = shift; |
|
83
|
174
|
|
|
|
|
539
|
my %args = @_; |
|
84
|
|
|
|
|
|
|
|
|
85
|
174
|
|
|
|
|
333
|
my @series; |
|
86
|
174
|
100
|
|
|
|
507
|
if ( $args{primary_axes} ) { |
|
87
|
87
|
|
|
|
|
642
|
@series = $self->_get_primary_axes_series; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
else { |
|
90
|
87
|
|
|
|
|
655
|
@series = $self->_get_secondary_axes_series; |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
174
|
100
|
|
|
|
638
|
return unless scalar @series; |
|
94
|
|
|
|
|
|
|
|
|
95
|
88
|
|
|
|
|
438
|
$self->xml_start_tag( 'c:lineChart' ); |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
# Write the c:grouping element. |
|
98
|
88
|
|
|
|
|
644
|
$self->_write_grouping( 'standard' ); |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# Write the series elements. |
|
101
|
88
|
|
|
|
|
604
|
$self->_write_series( $_ ) for @series; |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
# Write the c:dropLines element. |
|
104
|
88
|
|
|
|
|
774
|
$self->_write_drop_lines(); |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# Write the c:hiLowLines element. |
|
107
|
88
|
|
|
|
|
607
|
$self->_write_hi_low_lines(); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# Write the c:upDownBars element. |
|
110
|
88
|
|
|
|
|
745
|
$self->_write_up_down_bars(); |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# Write the c:marker element. |
|
113
|
88
|
|
|
|
|
341
|
$self->_write_marker_value(); |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# Write the c:axId elements |
|
116
|
88
|
|
|
|
|
815
|
$self->_write_axis_ids( %args ); |
|
117
|
|
|
|
|
|
|
|
|
118
|
88
|
|
|
|
|
344
|
$self->xml_end_tag( 'c:lineChart' ); |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
############################################################################## |
|
123
|
|
|
|
|
|
|
# |
|
124
|
|
|
|
|
|
|
# _write_d_pt_point() |
|
125
|
|
|
|
|
|
|
# |
|
126
|
|
|
|
|
|
|
# Write an individual element. Override the parent method to add |
|
127
|
|
|
|
|
|
|
# markers. |
|
128
|
|
|
|
|
|
|
# |
|
129
|
|
|
|
|
|
|
sub _write_d_pt_point { |
|
130
|
|
|
|
|
|
|
|
|
131
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
|
132
|
1
|
|
|
|
|
8
|
my $index = shift; |
|
133
|
1
|
|
|
|
|
2
|
my $point = shift; |
|
134
|
|
|
|
|
|
|
|
|
135
|
1
|
|
|
|
|
4
|
$self->xml_start_tag( 'c:dPt' ); |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
# Write the c:idx element. |
|
138
|
1
|
|
|
|
|
4
|
$self->_write_idx( $index ); |
|
139
|
|
|
|
|
|
|
|
|
140
|
1
|
|
|
|
|
4
|
$self->xml_start_tag( 'c:marker' ); |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# Write the c:spPr element. |
|
143
|
1
|
|
|
|
|
3
|
$self->_write_sp_pr( $point ); |
|
144
|
|
|
|
|
|
|
|
|
145
|
1
|
|
|
|
|
3
|
$self->xml_end_tag( 'c:marker' ); |
|
146
|
|
|
|
|
|
|
|
|
147
|
1
|
|
|
|
|
3
|
$self->xml_end_tag( 'c:dPt' ); |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
############################################################################## |
|
151
|
|
|
|
|
|
|
# |
|
152
|
|
|
|
|
|
|
# _write_marker_value() |
|
153
|
|
|
|
|
|
|
# |
|
154
|
|
|
|
|
|
|
# Write the element without a sub-element. |
|
155
|
|
|
|
|
|
|
# |
|
156
|
|
|
|
|
|
|
sub _write_marker_value { |
|
157
|
|
|
|
|
|
|
|
|
158
|
89
|
|
|
89
|
|
197
|
my $self = shift; |
|
159
|
|
|
|
|
|
|
|
|
160
|
89
|
|
|
|
|
312
|
my @attributes = ( 'val' => 1 ); |
|
161
|
|
|
|
|
|
|
|
|
162
|
89
|
|
|
|
|
391
|
$self->xml_empty_tag( 'c:marker', @attributes ); |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
1; |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
__END__ |