OFC/Dataset/OutlinedBar.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 97.4% 38 / 39 CC 2 SCAR 2.0
CC
2
Cov
100%
_parameters_for_type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« OFC/Pie.pm ↑ Summary OFC/Dataset/SketchBar.pm »
1 package Chart::OFC::Dataset::OutlinedBar;
2 22 $Chart::OFC::Dataset::OutlinedBar::VERSION = '0.12';
3 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 22 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 22 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 22 ▶use Chart::OFC::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 22 extends 'Chart::OFC::Dataset::Bar';
11  
12 22 has outline_color =>
13 ( is => 'ro',
14 isa => 'Chart::OFC::Type::Color',
15 coerce => 1,
16 default => '#000000',
17 );
18  
19 sub type
20 5 ▶{
Subroutine type: called CC=1 SCAR=0.0
Pod undocumented
21 5 return 'filled_bar';
22 }
23  
24 sub _parameters_for_type
25 9 ▶{
Subroutine _parameters_for_type: called CC=2 SCAR=6.9
26 9 my $self = shift;
27  
28 9 my @p = ( $self->opacity(), $self->fill_color(), $self->outline_color() );
29 9 ▶ push @p, ( $self->label(), $self->text_size() )
Branch: 1 branch
BranchTrueFalseTotal
if $self->_has_label 6 3 9
30 if $self->_has_label();
31  
32 9 return @p;
33 }
34  
35 22 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 22 __PACKAGE__->meta()->make_immutable();
38  
39 22 1;
40  
41  
42 =pod
43  
44 =for Pod::Coverage type
45  
46 =head1 SYNOPSIS
47  
48 my @numbers = (1, 2, 3);
49 my $bars = Chart::OFC::Dataset::OutlinedBar->new(
50 values => \@numbers,
51 opacity => 60,
52 fill_color => 'purple',
53 label => 'Daily Sales in $',
54 text_size => 12,
55 );
56  
57 =head1 DESCRIPTION
58  
59 This class contains values to be charted as bars on a grid chart. The
60 bars are filled with the specified color and have a separate outline
61 color. They are styled to give a "glass" look.
62  
63 =head1 ATTRIBUTES
64  
65 This class is a subclass of C<Chart::OFC::Dataset::Bar> and accepts
66 all of that class's attributes. It has one attribute of its own.
67  
68 =head2 outline_color
69  
70 This is the color used to outline the bar.
71  
72 Defaults to #000000 (black).
73  
74 =head1 ROLES
75  
76 This class does the C<Chart::OFC::Role::OFCDataLines> role.
77  
78 =cut
« OFC/Pie.pm ↑ Summary OFC/Dataset/SketchBar.pm »