WriteExcel/Chart/Scatter.pm

filter: Statementstmt 65.9% 29 / 44 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 1 totaltotal 65.3% 34 / 52 CC 1 SCAR 2.5
CC
1
Cov
66%
_store_axis_category_stream
2.0
_store_marker_dataformat_stream
2.0
BEGIN
1.0
CRAP 1.3
« WriteExcel.pm ↑ Summary WriteExcel/Chart/Stock.pm »
1 package Spreadsheet::WriteExcel::Chart::Scatter;
2  
3 ###############################################################################
4 #
5 # Scatter - A writer class for Excel Scatter 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 SCATTER chart BIFF record. Defines a scatter chart type.
49 #
50 1 ▶sub _store_chart_type {
Subroutine _store_chart_type: called CC=1 SCAR=0.0
51  
52 1 my $self = shift;
53  
54 1 my $record = 0x101B; # Record identifier.
55 1 my $length = 0x0006; # Number of bytes to follow.
56 1 my $bubble_ratio = 0x0064; # Bubble ratio.
57 1 my $bubble_type = 0x0001; # Bubble type.
58 1 my $grbit = 0x0000; # Option flags.
59  
60 1 my $header = pack 'vv', $record, $length;
61 1 my $data = '';
62 1 $data .= pack 'v', $bubble_ratio;
63 1 $data .= pack 'v', $bubble_type;
64 1 $data .= pack 'v', $grbit;
65  
66 1 $self->_append( $header, $data );
67 }
68  
69  
70 ###############################################################################
71 #
72 # _store_axis_category_stream(). Overridden.
73 #
74 # Write the AXIS chart substream for the chart category.
75 #
76 # For a Scatter chart the category stream is replace with a values stream. We
77 # override this method and turn it into a values stream.
78 #
79 0 ▶sub _store_axis_category_stream {
Subroutine _store_axis_category_stream: not called CC=1 SCAR=6.9
80  
81 0 my $self = shift;
82  
83 0 $self->_store_axis( 0 );
84  
85 0 $self->_store_begin();
86 0 $self->_store_valuerange();
87 0 $self->_store_tick();
88 0 $self->_store_end();
89 }
90  
91  
92 ###############################################################################
93 #
94 # _store_marker_dataformat_stream(). Overridden.
95 #
96 # This is an implementation of the parent abstract method to define
97 # properties of markers, linetypes, pie formats and other.
98 #
99 0 ▶sub _store_marker_dataformat_stream {
Subroutine _store_marker_dataformat_stream: not called CC=1 SCAR=6.9
100  
101 0 my $self = shift;
102  
103 0 $self->_store_dataformat( 0x0000, 0xFFFD, 0x0000 );
104  
105 0 $self->_store_begin();
106 0 $self->_store_3dbarshape();
107 0 $self->_store_lineformat( 0x00000000, 0x0005, 0xFFFF, 0x0008, 0x004D );
108 0 $self->_store_areaformat( 0x00FFFFFF, 0x0000, 0x01, 0x01, 0x4E, 0x4D );
109 0 $self->_store_pieformat();
110 0 $self->_store_markerformat( 0x00, 0x00, 0x02, 0x01, 0x4D, 0x4D, 0x3C );
111 0 $self->_store_end();
112  
113 }
114  
115  
116 1 1;
117  
118  
119 __END__
« WriteExcel.pm ↑ Summary WriteExcel/Chart/Stock.pm »