WriteExcel/Chart/Stock.pm

filter: Statementstmt 53.3% 24 / 45 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 55.7% 29 / 52 CC 1 SCAR 1.5
CC
1
Cov
53%
_store_marker_dataformat_stream
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« WriteExcel/Chart/Scatter.pm ↑ Summary WriteExcel/Chart/Pie.pm »
1 package Spreadsheet::WriteExcel::Chart::Stock;
2  
3 ###############################################################################
4 #
5 # Stock - A writer class for Excel Stock charts.
6 #
7 # Used in conjunction with Spreadsheet::WriteExcel::Chart.
8 #
9 # See formatting note in Spreadsheet::WriteExcel::Chart.
10 #
11 # Copyright 2000-2010, John McNamara, jmcnamara@cpan.org
12 #
13 # Documentation after __END__
14 #
15  
16 1 require Exporter;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Spreadsheet::WriteExcel::Chart;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21  
22 1 ▶use vars qw($VERSION @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 @ISA = qw(Spreadsheet::WriteExcel::Chart Exporter);
24  
25 1 $VERSION = '2.40';
26  
27 ###############################################################################
28 #
29 # new()
30 #
31 #
32 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
33  
34 1 my $class = shift;
35 1 my $self = Spreadsheet::WriteExcel::Chart->new( @_ );
36  
37 1 bless $self, $class;
38 1 return $self;
39 }
40  
41  
42 ###############################################################################
43 #
44 # _store_chart_type()
45 #
46 # Implementation of the abstract method from the specific chart class.
47 #
48 # Write the LINE chart BIFF record. A stock chart uses the same LINE record
49 # as a line chart but with additional DROPBAR and CHARTLINE records to define
50 # the stock style.
51 #
52 1 ▶sub _store_chart_type {
Subroutine _store_chart_type: called CC=1 SCAR=0.0
53  
54 1 my $self = shift;
55  
56 1 my $record = 0x1018; # Record identifier.
57 1 my $length = 0x0002; # Number of bytes to follow.
58 1 my $grbit = 0x0000; # Option flags.
59  
60 1 my $header = pack 'vv', $record, $length;
61 1 my $data = pack 'v', $grbit;
62  
63 1 $self->_append( $header, $data );
64 }
65  
66 ###############################################################################
67 #
68 # _store_marker_dataformat_stream(). Overridden.
69 #
70 # This is an implementation of the parent abstract method to define
71 # properties of markers, linetypes, pie formats and other.
72 #
73 0 ▶sub _store_marker_dataformat_stream {
Subroutine _store_marker_dataformat_stream: not called CC=1 SCAR=6.9
74  
75 0 my $self = shift;
76  
77 0 $self->_store_dropbar();
78 0 $self->_store_begin();
79 0 $self->_store_lineformat( 0x00000000, 0x0000, 0xFFFF, 0x0001, 0x004F );
80 0 $self->_store_areaformat( 0x00FFFFFF, 0x0000, 0x01, 0x01, 0x09, 0x08 );
81 0 $self->_store_end();
82  
83 0 $self->_store_dropbar();
84 0 $self->_store_begin();
85 0 $self->_store_lineformat( 0x00000000, 0x0000, 0xFFFF, 0x0001, 0x004F );
86 0 $self->_store_areaformat( 0x0000, 0x00FFFFFF, 0x01, 0x01, 0x08, 0x09 );
87 0 $self->_store_end();
88  
89 0 $self->_store_chartline();
90 0 $self->_store_lineformat( 0x00000000, 0x0000, 0xFFFF, 0x0000, 0x004F );
91  
92  
93 0 $self->_store_dataformat( 0x0000, 0xFFFD, 0x0000 );
94 0 $self->_store_begin();
95 0 $self->_store_3dbarshape();
96 0 $self->_store_lineformat( 0x00000000, 0x0005, 0xFFFF, 0x0000, 0x004F );
97 0 $self->_store_areaformat( 0x00000000, 0x0000, 0x00, 0x01, 0x4D, 0x4D );
98 0 $self->_store_pieformat();
99 0 $self->_store_markerformat( 0x00, 0x00, 0x00, 0x00, 0x4D, 0x4D, 0x3C );
100 0 $self->_store_end();
101  
102 }
103  
104  
105 1 1;
106  
107  
108 __END__
« WriteExcel/Chart/Scatter.pm ↑ Summary WriteExcel/Chart/Pie.pm »