| 1 | package Chart::Clicker::Data::Marker; | ||
| 2 | 4 | $Chart::Clicker::Data::Marker::VERSION = '2.89'; | |
| 3 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # ABSTRACT: Highlight arbitrary value(s) | ||
| 6 | |||
| 7 | 4 | ▶ | use Graphics::Color::RGB; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | ▶ | use Graphics::Primitive::Brush; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | |||
| 11 | has 'brush' => ( | ||
| 12 | is => 'rw', | ||
| 13 | isa => 'Graphics::Primitive::Brush', | ||
| 14 | default => sub { | ||
| 15 | 5 | ▶ | Graphics::Primitive::Brush->new(width => 1); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | } | ||
| 17 | 4 | ); | |
| 18 | |||
| 19 | |||
| 20 | has 'color' => ( | ||
| 21 | is => 'rw', | ||
| 22 | isa => 'Graphics::Color', | ||
| 23 | default => sub { | ||
| 24 | 5 | ▶ | Graphics::Color::RGB->new( |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 25 | red => 0, green => 0, blue => 0, alpha => 1 | ||
| 26 | ); | ||
| 27 | } | ||
| 28 | 4 | ); | |
| 29 | |||
| 30 | |||
| 31 | has 'inside_color' => ( | ||
| 32 | is => 'rw', | ||
| 33 | isa => 'Graphics::Color', | ||
| 34 | default => sub { | ||
| 35 | 5 | ▶ | Graphics::Color::RGB->new( |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 36 | red => 0, green => 0, blue => 0, alpha => 1 | ||
| 37 | ); | ||
| 38 | } | ||
| 39 | 4 | ); | |
| 40 | |||
| 41 | |||
| 42 | 4 | has 'key' => ( is => 'rw', isa => 'Num' ); | |
| 43 | |||
| 44 | |||
| 45 | 4 | has 'key2' => ( is => 'rw', isa => 'Num' ); | |
| 46 | |||
| 47 | |||
| 48 | 4 | has 'value' => ( is => 'rw', isa => 'Num' ); | |
| 49 | |||
| 50 | |||
| 51 | 4 | has 'value2' => ( is => 'rw', isa => 'Num' ); | |
| 52 | |||
| 53 | 4 | __PACKAGE__->meta->make_immutable; | |
| 54 | |||
| 55 | 4 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 56 | |||
| 57 | 4 | 1; | |
| 58 | |||
| 59 | __END__ | ||
| 60 | |||
| 61 | =pod | ||
| 62 | |||
| 63 | =head1 NAME | ||
| 64 | |||
| 65 | Chart::Clicker::Data::Marker - Highlight arbitrary value(s) | ||
| 66 | |||
| 67 | =head1 VERSION | ||
| 68 | |||
| 69 | version 2.89 | ||
| 70 | |||
| 71 | =head1 SYNOPSIS | ||
| 72 | |||
| 73 | use Chart::Clicker::Data::Marker; | ||
| 74 | use Graphics::Color::RGB; | ||
| 75 | use Graphics::Primitive::Brush; | ||
| 76 | |||
| 77 | my $cc = Chart::Clicker->new; | ||
| 78 | |||
| 79 | my $mark = Chart::Clicker::Data::Marker->new( | ||
| 80 | color => Graphics::Color::RGB->new, | ||
| 81 | brush => Graphics::Primitive::Brush->new, | ||
| 82 | key => 12, | ||
| 83 | value => 123, | ||
| 84 | # Optionally | ||
| 85 | key2 => 13, | ||
| 86 | value => 146 | ||
| 87 | ); | ||
| 88 | |||
| 89 | my $ctx = $cc->get_context('default'); | ||
| 90 | $ctx->add_marker($mark); | ||
| 91 | |||
| 92 | $cc->write_output('foo.png'); | ||
| 93 | |||
| 94 | =head1 DESCRIPTION | ||
| 95 | |||
| 96 | Used to highlight a particular key, value or range of either. | ||
| 97 | |||
| 98 | =head1 ATTRIBUTES | ||
| 99 | |||
| 100 | =head2 brush | ||
| 101 | |||
| 102 | Set/Get the L<brush|Graphics::Primitive::Brush> for this Marker. | ||
| 103 | |||
| 104 | =head2 color | ||
| 105 | |||
| 106 | Set/Get the L<color|Graphics::Primitive::Color> for this marker. | ||
| 107 | |||
| 108 | =head2 inside_color | ||
| 109 | |||
| 110 | Set/Get the inside L<color|Graphics::Primitive::Color>, which will be used if this range has two keys and | ||
| 111 | two values. | ||
| 112 | |||
| 113 | =head2 key | ||
| 114 | |||
| 115 | Set/Get the key for this marker. This represents a point on the domain. | ||
| 116 | |||
| 117 | =head2 key2 | ||
| 118 | |||
| 119 | Set/Get the key2 for this marker. This represents a second point on the domain | ||
| 120 | and is used to specify a range. | ||
| 121 | |||
| 122 | =head2 value | ||
| 123 | |||
| 124 | Set/Get the value for this marker. This represents a point on the range. | ||
| 125 | |||
| 126 | =head2 value2 | ||
| 127 | |||
| 128 | Set/Get the value2 for this marker. This represents a second point on the | ||
| 129 | range and is used to specify a range. | ||
| 130 | |||
| 131 | =head1 AUTHOR | ||
| 132 | |||
| 133 | Cory G Watson <gphat@cpan.org> | ||
| 134 | |||
| 135 | =head1 COPYRIGHT AND LICENSE | ||
| 136 | |||
| 137 | This software is copyright (c) 2016 by Cory G Watson. | ||
| 138 | |||
| 139 | This is free software; you can redistribute it and/or modify it under | ||
| 140 | the same terms as the Perl 5 programming language system itself. | ||
| 141 | |||
| 142 | =cut | ||