| 1 | package Chart::OFC::XAxis; | ||||||||||
| 2 | 21 | $Chart::OFC::XAxis::VERSION = '0.12'; | |||||||||
| 3 | 21 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 21 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 21 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 21 | ▶ | use MooseX::StrictConstructor; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 21 | ▶ | use Chart::OFC::Types; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 21 | extends 'Chart::OFC::Axis'; | |||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 21 | has labels => | |||||||||
| 14 | ( is => 'ro', | ||||||||||
| 15 | isa => 'Chart::OFC::Type::NonEmptyArrayRef', | ||||||||||
| 16 | predicate => '_has_labels', | ||||||||||
| 17 | ); | ||||||||||
| 18 | |||||||||||
| 19 | 21 | has label_steps => | |||||||||
| 20 | ( is => 'ro', | ||||||||||
| 21 | isa => 'Chart::OFC::Type::PosInt', | ||||||||||
| 22 | default => 1, | ||||||||||
| 23 | ); | ||||||||||
| 24 | |||||||||||
| 25 | 21 | has tick_steps => | |||||||||
| 26 | ( is => 'ro', | ||||||||||
| 27 | isa => 'Chart::OFC::Type::PosInt', | ||||||||||
| 28 | predicate => '_has_tick_steps', | ||||||||||
| 29 | ); | ||||||||||
| 30 | |||||||||||
| 31 | 21 | has three_d_height => | |||||||||
| 32 | ( is => 'ro', | ||||||||||
| 33 | isa => 'Chart::OFC::Type::PosInt', | ||||||||||
| 34 | predicate => '_has_three_d_height', | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | 21 | has orientation => | |||||||||
| 38 | ( is => 'ro', | ||||||||||
| 39 | isa => 'Chart::OFC::Type::Orientation', | ||||||||||
| 40 | default => 'horizontal', | ||||||||||
| 41 | ); | ||||||||||
| 42 | |||||||||||
| 43 | 21 | my %Orientation = ( horizontal => 0, | |||||||||
| 44 | vertical => 1, | ||||||||||
| 45 | diagonal => 2, | ||||||||||
| 46 | ); | ||||||||||
| 47 | sub _ofc_data_lines | ||||||||||
| 48 | 13 | ▶ | { | ||||||||
|
Subroutine
_ofc_data_lines: called CC=7 SCAR=19.5
| |||||||||||
| 49 | 13 | my $self = shift; | |||||||||
| 50 | |||||||||||
| 51 | 13 | my @lines = $self->axis_label()->_ofc_data_lines('x'); | |||||||||
| 52 | |||||||||||
| 53 | 13 | ▶ | push @lines, $self->_data_line( 'x_labels', @{ $self->labels() } ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | if $self->_has_labels(); | ||||||||||
| 55 | |||||||||||
| 56 | push @lines, $self->_data_line( 'x_label_style', | ||||||||||
| 57 | $self->text_size(), | ||||||||||
| 58 | $self->text_color(), | ||||||||||
| 59 | 13 | ▶ | $Orientation{ $self->orientation() }, | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | $self->label_steps(), | ||||||||||
| 61 | ( $self->_has_grid_color() ? $self->grid_color() : () ), | ||||||||||
| 62 | ); | ||||||||||
| 63 | |||||||||||
| 64 | 13 | ▶ | push @lines, $self->_data_line( 'x_ticks', $self->tick_steps() ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | if $self->_has_tick_steps(); | ||||||||||
| 66 | |||||||||||
| 67 | 13 | ▶ | push @lines, $self->_data_line( 'x_axis_3d', $self->three_d_height() ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | if $self->_has_three_d_height(); | ||||||||||
| 69 | |||||||||||
| 70 | 13 | ▶ | push @lines, $self->_data_line( 'x_axis_color', $self->axis_color() ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 71 | if $self->_has_axis_color(); | ||||||||||
| 72 | |||||||||||
| 73 | 13 | ▶ | push @lines, $self->_data_line( 'x_axis_steps', $self->tick_steps() ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 74 | if $self->_has_tick_steps(); | ||||||||||
| 75 | |||||||||||
| 76 | 13 | return @lines; | |||||||||
| 77 | } | ||||||||||
| 78 | |||||||||||
| 79 | 21 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 80 | |||||||||||
| 81 | 21 | __PACKAGE__->meta()->make_immutable(); | |||||||||
| 82 | |||||||||||
| 83 | 21 | 1; | |||||||||
| 84 | |||||||||||
| 85 | |||||||||||
| 86 | # ABSTRACT: X axis for grid charts | ||||||||||
| 87 | |||||||||||
| 88 | __END__ | ||||||||||