line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chart::OFC::YAxis; |
2
|
|
|
|
|
|
|
$Chart::OFC::YAxis::VERSION = '0.12'; |
3
|
17
|
|
|
17
|
|
34632
|
use strict; |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
777
|
|
4
|
17
|
|
|
17
|
|
131
|
use warnings; |
|
17
|
|
|
|
|
41
|
|
|
17
|
|
|
|
|
601
|
|
5
|
|
|
|
|
|
|
|
6
|
17
|
|
|
17
|
|
7181
|
use Moose; |
|
17
|
|
|
|
|
648744
|
|
|
17
|
|
|
|
|
160
|
|
7
|
17
|
|
|
17
|
|
92835
|
use MooseX::StrictConstructor; |
|
17
|
|
|
|
|
29304
|
|
|
17
|
|
|
|
|
365
|
|
8
|
17
|
|
|
17
|
|
85664
|
use Chart::OFC::Types; |
|
17
|
|
|
|
|
48
|
|
|
17
|
|
|
|
|
5842
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Chart::OFC::Axis'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has min => |
14
|
|
|
|
|
|
|
( is => 'ro', |
15
|
|
|
|
|
|
|
isa => 'Num', |
16
|
|
|
|
|
|
|
default => 0, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has max => |
20
|
|
|
|
|
|
|
( is => 'ro', |
21
|
|
|
|
|
|
|
isa => 'Num', |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has small_tick_size => |
26
|
|
|
|
|
|
|
( is => 'ro', |
27
|
|
|
|
|
|
|
isa => 'Int', |
28
|
|
|
|
|
|
|
default => 5, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has large_tick_size => |
32
|
|
|
|
|
|
|
( is => 'ro', |
33
|
|
|
|
|
|
|
isa => 'Int', |
34
|
|
|
|
|
|
|
default => 10, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has label_steps => |
38
|
|
|
|
|
|
|
( is => 'ro', |
39
|
|
|
|
|
|
|
isa => 'Chart::OFC::Type::PosInt', |
40
|
|
|
|
|
|
|
required => 1, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _ofc_data_lines |
44
|
|
|
|
|
|
|
{ |
45
|
10
|
|
|
10
|
|
35
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
10
|
|
|
|
|
371
|
my @lines = $self->axis_label()->_ofc_data_lines('y'); |
48
|
|
|
|
|
|
|
|
49
|
10
|
|
|
|
|
388
|
push @lines, $self->_data_line( 'y_label_style', |
50
|
|
|
|
|
|
|
$self->text_size(), |
51
|
|
|
|
|
|
|
$self->text_color(), |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
10
|
|
|
|
|
377
|
push @lines, $self->_data_line( 'y_ticks', |
55
|
|
|
|
|
|
|
$self->small_tick_size(), |
56
|
|
|
|
|
|
|
$self->large_tick_size(), |
57
|
|
|
|
|
|
|
int( ( $self->max() - $self->min() ) / $self->label_steps() ), |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
10
|
|
|
|
|
340
|
push @lines, $self->_data_line( 'y_min', $self->min() ); |
61
|
|
|
|
|
|
|
|
62
|
10
|
|
|
|
|
337
|
push @lines, $self->_data_line( 'y_max', $self->max() ); |
63
|
|
|
|
|
|
|
|
64
|
10
|
100
|
|
|
|
480
|
push @lines, $self->_data_line( 'y_axis_colour', $self->axis_color() ) |
65
|
|
|
|
|
|
|
if $self->_has_axis_color(); |
66
|
|
|
|
|
|
|
|
67
|
10
|
100
|
|
|
|
516
|
push @lines, $self->_data_line( 'y_grid_colour', $self->grid_color() ) |
68
|
|
|
|
|
|
|
if $self->_has_grid_color(); |
69
|
|
|
|
|
|
|
|
70
|
10
|
|
|
|
|
84
|
return @lines; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
17
|
|
|
17
|
|
122
|
no Moose; |
|
17
|
|
|
|
|
39
|
|
|
17
|
|
|
|
|
123
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# ABSTRACT: Y axis for grid charts |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=pod |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 NAME |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Chart::OFC::YAxis - Y axis for grid charts |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 VERSION |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
version 0.12 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 DESCRIPTION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This class represents the Y axis for a grid chart. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This class is a subclass of C<Chart::OFC::Axis> and accepts all of |
101
|
|
|
|
|
|
|
that class's attribute. It has several attributes of its own which may |
102
|
|
|
|
|
|
|
be passed to the C<new()> method. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Note that because its label is display vertically, Unicode characters |
105
|
|
|
|
|
|
|
in the label will not display correctly, according to the OFC docs. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 min |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This is the minimum value to show on the Y axis. It must be a number. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Defaults to 0. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 max |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This is the maximum value to show on the Y axis. It must be a number. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This attribute is required. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 small_tick_size |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
The size of a small tick, in pixels. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Defaults to 5. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 large_tick_size |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
The size of a large tick, in pixels. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Defaults to 10. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 label_steps |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Show a label every N values. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This attribute is required. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Note that the definition of this attribute is different than how OFC |
138
|
|
|
|
|
|
|
defines it, but is consistent with the same attribute for the X axis |
139
|
|
|
|
|
|
|
(unlike OFC). |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 ROLES |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
This class does the C<Chart::OFC::Role::OFCDataLines> role. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 AUTHOR |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Dave Rolsky. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
This is free software, licensed under: |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |