line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chart::OFC::Dataset::SketchBar; |
2
|
|
|
|
|
|
|
$Chart::OFC::Dataset::SketchBar::VERSION = '0.12'; |
3
|
16
|
|
|
16
|
|
100
|
use strict; |
|
16
|
|
|
|
|
37
|
|
|
16
|
|
|
|
|
698
|
|
4
|
16
|
|
|
16
|
|
114
|
use warnings; |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
5808
|
|
5
|
|
|
|
|
|
|
|
6
|
16
|
|
|
16
|
|
290
|
use Moose; |
|
16
|
|
|
|
|
38
|
|
|
16
|
|
|
|
|
329
|
|
7
|
16
|
|
|
16
|
|
118391
|
use MooseX::StrictConstructor; |
|
16
|
|
|
|
|
42
|
|
|
16
|
|
|
|
|
263
|
|
8
|
16
|
|
|
16
|
|
56249
|
use Chart::OFC::Types; |
|
16
|
|
|
|
|
45
|
|
|
16
|
|
|
|
|
2875
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Chart::OFC::Dataset::OutlinedBar'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has randomness => |
13
|
|
|
|
|
|
|
( is => 'ro', |
14
|
|
|
|
|
|
|
isa => 'Chart::OFC::Type::PosOrZeroInt', |
15
|
|
|
|
|
|
|
default => '3', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub type |
19
|
|
|
|
|
|
|
{ |
20
|
3
|
|
|
3
|
0
|
10
|
return 'bar_sketch'; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _parameters_for_type |
24
|
|
|
|
|
|
|
{ |
25
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
|
|
173
|
my @p = ( $self->opacity(), $self->randomness(), |
28
|
|
|
|
|
|
|
$self->fill_color(), $self->outline_color() ); |
29
|
3
|
100
|
|
|
|
166
|
push @p, ( $self->label(), $self->text_size() ) |
30
|
|
|
|
|
|
|
if $self->_has_label(); |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
32
|
return @p; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
16
|
|
|
16
|
|
142
|
no Moose; |
|
16
|
|
|
|
|
37
|
|
|
16
|
|
|
|
|
140
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# ABSTRACT: A dataset represented as "sketch" bars |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Chart::OFC::Dataset::SketchBar - A dataset represented as "sketch" bars |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
version 0.12 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my @numbers = (1, 2, 3); |
58
|
|
|
|
|
|
|
my $bars = Chart::OFC::Dataset::SketchBar->new( |
59
|
|
|
|
|
|
|
values => \@numbers, |
60
|
|
|
|
|
|
|
opacity => 60, |
61
|
|
|
|
|
|
|
randomness => 5, |
62
|
|
|
|
|
|
|
fill_color => 'purple', |
63
|
|
|
|
|
|
|
label => 'Candy totals', |
64
|
|
|
|
|
|
|
text_size => 12, |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 DESCRIPTION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This class contains values to be charted as bars on a grid chart. The |
70
|
|
|
|
|
|
|
bars are filled with the specified color in the style of a child's |
71
|
|
|
|
|
|
|
crayon drawing. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=for Pod::Coverage type |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This class is a subclass of C<Chart::OFC::Dataset::OutlinedBar> and |
78
|
|
|
|
|
|
|
accepts all of that class's attributes. It has one attribute of its own. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 randomness |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This is an integer (0 or greater) defining how random the sketch style |
83
|
|
|
|
|
|
|
is. The greater it is the more random the look. The default value is 3. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 ROLES |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This class does the C<Chart::OFC::Role::OFCDataLines> role. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Dave Rolsky. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This is free software, licensed under: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |