Codebase list libchart-clicker-perl / 525b16e
[svn-upgrade] Integrating new upstream version, libchart-clicker-perl (2.62) Jonathan Yu 14 years ago
39 changed file(s) with 387 addition(s) and 141 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension Chart::Clicker.
1
2 2.62
3 - More POD fixes
4
5 2.61
6 - Add bar_width attribute to Bar and StackedBar renderers for choosing your
7 own bar width.
8 - Remove unnecessary type declaration from Axis
9 - POD errors (spotted by Ricardo Signes)
10 - Add POD 'whatis' entries (RT #56287, Jonathan Yu)
11 - Update README (RT #56396, Jonathan Yu)
12 - Add missing dependency on Test::Exception (RT #56398, Jonathan Yu)
113
214 2.60 March 20, 2010
315 - Add gradient_reverse attribute to Pie renderer for reverse the
66 example/heatmap.pl
77 example/line-and-shape.pl
88 example/line.pl
9 example/markers.pl
109 example/multiple-axes.pl
1110 example/multiple-renderers.pl
1211 example/overaxis-bar.pl
33 - 'Cory G Watson <gphat@cpan.org>'
44 build_requires:
55 ExtUtils::MakeMaker: 6.42
6 Test::Exception: 0
67 configure_requires:
78 ExtUtils::MakeMaker: 6.42
89 distribution_type: module
3738 resources:
3839 license: http://dev.perl.org/licenses/
3940 repository: http://github.com/gphat/chart-clicker
40 version: 2.60
41 version: 2.62
11
22 name 'Chart-Clicker';
33 all_from 'lib/Chart/Clicker.pm';
4
5 test_requires 'Test::Exception';
46
57 requires 'Color::Scheme' => '1.02';
68 requires 'Moose' => '0.76';
1719 requires 'Layout::Manager' => '0.31';
1820 requires 'Math::Gradient' => '0.04';
1921
20
21
2222 recommends 'Statistics::Basic' => 0;
2323
2424 repository 'http://github.com/gphat/chart-clicker';
+295
-40
README less more
0 Chart::Clicker
1 ==================
2
3 The README is used to introduce the module and provide instructions on
4 how to install the module, any machine dependencies it may have (for
5 example C compilers and installed libraries) and any other information
6 that should be provided before the module is installed.
7
8 A README file is required for CPAN modules since CPAN extracts the
9 README file from a module distribution so that people browsing the
10 archive can use it get an idea of the modules uses. It is usually a
11 good idea to provide version information here so that people can
12 decide whether fixes for the module are worth downloading.
13
14 INSTALLATION
15
16 To install this module type the following:
17
18 perl Makefile.PL
19 make
20 make test
21 make install
22
23 DEPENDENCIES
24
25 This module requires these other modules and libraries:
26
27 blah blah blah
28
29 COPYRIGHT AND LICENCE
30
31 Put the correct copyright and licence information here.
32
33 Copyright (C) 2007 by gphat
34
35 This library is free software; you can redistribute it and/or modify
36 it under the same terms as Perl itself, either Perl version 5.8.6 or,
37 at your option, any later version of Perl 5 you may have available.
38
39
0 NAME
1 Chart::Clicker - Powerful, extensible charting.
2
3 SYNOPSIS
4 use Chart::Clicker;
5
6 my $cc = Chart::Clicker->new;
7
8 my @values = (42, 25, 86, 23, 2, 19, 103, 12, 54, 9);
9 $cc->add_data('Sales', \@values);
10
11 # alternately, you can add data one bit at a time...
12 foreach my $v (@values) {
13 $cc->add_data('Sales', $v);
14 }
15
16 # Or, if you want to specify the keys you can use a hashref
17 my $data = { 12 => 123, 13 => 341, 14 => 1241 };
18 $cc->add_data('Sales', $data);
19
20 $cc->write_output('foo.png');
21
22 DESCRIPTION
23 Chart::Clicker aims to be a powerful, extensible charting package that
24 creates really pretty output. Charts can be saved in png, svg, pdf and
25 postscript format.
26
27 Clicker leverages the power of Graphics::Primitive to create snazzy
28 graphics without being tied to specific backend. You may want to begin
29 with Chart::Clicker::Tutorial.
30
31 For code examples see the examples repository on GitHub:
32 <http://github.com/gphat/chart-clicker-examples/>
33
34 FEATURES
35 Renderers
36 Clicker supports the following renderers:
37
38 Line
39 StackedLine
40 Bar
41 StackedBar
42 Area
43 StackedArea
44 Bubble
45 CandleStick
46 Point
47 Pie
48 PolarArea
49
50 ADDING DATA
51 The synopsis shows the simple way to add data.
52
53 my @values = (42, 25, 86, 23, 2, 19, 103, 12, 54, 9);
54 foreach my $v (@values) {
55 $cc->add_data('Sales', $v);
56 }
57
58 This is a convenience method provided to make simple cases much simpler.
59 Adding multiple Series to a chart is as easy as changing the name
60 argument of "add_data". Each unique first argument will result in a
61 separate series. See the docs for "add_data" to learn more.
62
63 If you'd like to use the more advanced features of Clicker you'll need
64 to shake off this simple method and build Series & DataSets explicitly.
65
66 use Chart::Clicker::Data::Series;
67 use Chart::Clicker::Data::DataSet;
68
69 ...
70
71 my $series = Chart::Clicker::Data::Series->new(
72 keys => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ],
73 values => [ 42, 25, 86, 23, 2, 19, 103, 12, 54, 9 ],
74 );
75
76 my $ds = Chart::Clicker::Data::DataSet->new(series => [ $series ]);
77
78 $cc->add_to_datasets($ds);
79
80 This used to be the only way to add data, but repeated requests to make
81 the common case easier resulted in the inclusion of "add_data".
82
83 COOKBOOK
84 Check the cookbook at <http://www.onemogin.com/clicker/cookbook>
85
86 CONTEXTS
87 The normal use case for a chart is a couple of datasets on the same
88 axes. Sometimes you want to chart one or more datasets on different
89 axes. A common need for this is when you are comparing two datasets of
90 vastly different scale such as the number of employees in an office
91 (1-10) to monthly revenues (10s of thousands). On a normal chart the
92 number of employees would show up as a flat line at the bottom of the
93 chart.
94
95 To correct this, Clicker has contexts. A context is a pair of axes, a
96 renderer and a name. The name is the 'key' by which you will refer to
97 the context.
98
99 my $context = Chart::Clicker::Context->new( name => 'sales' );
100 $clicker->add_to_contexts($context);
101
102 $dataset->context('sales');
103
104 $clicker->add_to_datasets($dataset);
105
106 New contexts provide a fresh domain and range axis and default to a Line
107 renderer.
108
109 Caveat: Clicker expects that the default context (identified by the
110 string "default") will always be present. It is from this context that
111 some of Clicker's internals draw their values. You should use the
112 default context unless you need more than one, in which case you should
113 use "default" as the base context.
114
115 FORMATS & OUTPUT
116 Clicker supports PNG, SVG, PDF and PostScript output. To change your
117 output type, specificy it when you create your Clicker object:
118
119 my $cc = Chart::Clicker->new(format => 'pdf', ...);
120 # ...
121 $cc->write_output('chart.pdf');
122
123 If you are looking to get a scalar of the output for use with HTTP or
124 similar things, you can use:
125
126 # ... make your chart
127 $cc->draw;
128 my $image_data = $cc->data;
129
130 If you happen to be using Catalyst then take a look at
131 Catalyst::View::Graphics::Primitive.
132
133 ATTRIBUTES
134 contexts
135 Set/Get the contexts for this chart.
136
137 datasets
138 Get/Set the datasets for this chart.
139
140 format
141 Get the format for this Chart. Required in the constructor. Must be on
142 of Png, Pdf, Ps or Svg.
143
144 legend
145 Set/Get the legend that will be used with this chart.
146
147 legend_position
148 The position the legend will be added. Should be one of north, south,
149 east, west or center as required by Layout::Manager::Compass.
150
151 grid_over
152 Flag controlling if the grid is rendered over the data. Defaults to 0.
153 You probably want to set the grid's background color to an alpha of 0 if
154 you enable this flag.
155
156 title
157 Set/Get the title component for this chart. This is a
158 Graphics::Primitive::TextBox, not a string. To set the title of a chart
159 you should access the TextBox's "text" method.
160
161 $cc->title->text('A Title!');
162 $cc->title->font->size(20);
163 # etc, etc
164
165 If the title has text then it is added to the chart in the position
166 specified by "title_position".
167
168 You should consult the documentation for Graphics::Primitive::TextBox
169 for things like padding and text rotation. If you are adding it to the
170 top and want some padding between it and the plot, you can:
171
172 $cc->title->padding->bottom(5);
173
174 title_position
175 The position the title will be added. Should be one of north, south,
176 east, west or center as required by Layout::Manager::Compass.
177
178 Note that if no angle is set for the title then it will be changed to
179 -1.5707 if the title position is east or west.
180
181 METHODS
182 new
183 Creates a new Chart::Clicker object. If no format, width and height are
184 specified then defaults of Png, 500 and 300 are chosen, respectively.
185
186 add_data ($name, $data)
187 Convenience method for adding data to the chart. Can be called one of
188 three ways.
189
190 scalar
191 Passing a name and a scalar will "add" the scalar data to that
192 series' data.
193
194 $cc->add_data('Sales', 1234);
195 $cc->add_data('Sales', 1235);
196
197 This will result in a Series names 'Sales' with two values.
198
199 arrayref
200 Passing a name and an arrayref works much the same as the scalar
201 method discussed above, but appends the supplied arrayref to the
202 existing one. It may be mixed with the scalar method.
203
204 $cc->add_data('Sales', \@some_sales);
205 $cc->add_data('Sales', \@some_more_sales);
206 # This works still!
207 $cc->add_data('Sales', 1234);
208
209 hashref
210 This allows you to pass both keys and add in all at once, but it's
211 an all-or-nothing thing. Subsequent calls with the same name will
212 overwrite previous calls.
213
214 $cc->add_data('Sales', { 2009 => 1234, 2010 => 1235 });
215 # Overwrites last call!
216 $cc->add_data('Sales', { 2011 => 1234, 2012 => 1235 });
217
218 add_to_contexts
219 Add the specified context to the chart.
220
221 add_to_datasets
222 Add the specified dataset (or arrayref of datasets) to the chart.
223
224 add_to_markers
225 Add the specified marker to the chart.
226
227 color_allocator
228 Set/Get the color_allocator for this chart.
229
230 data
231 Returns the data for this chart as a scalar. Suitable for 'streaming' to
232 a client.
233
234 draw
235 Draw this chart.
236
237 get_datasets_for_context
238 Returns an arrayref containing all datasets for the given context. Used
239 by renderers to get a list of datasets to chart.
240
241 inside_width
242 Get the width available in this container after taking away space for
243 insets and borders.
244
245 inside_height
246 Get the height available in this container after taking away space for
247 insets and borders.
248
249 marker_overlay
250 Set/Get the marker overlay object that will be used if this chart has
251 markers. This is lazily constructed to save time.
252
253 set_renderer ($renderer_object, [ $context ]);
254 Sets the renderer on the specified context. If no context is provided
255 then 'default' is assumed.
256
257 write
258 This method is passed through to the underlying driver. It is only
259 necessary that you call this if you manually called "draw" beforehand.
260 You likely want to use "write_output".
261
262 write_output ($path)
263 Write the chart output to the specified location. Output is written in
264 the format provided to the constructor (which defaults to Png).
265 Internally calls "draw" for you. If you use this method, do not call
266 "draw" first!
267
268 $c->write_output('/path/to/the.png');
269
270 AUTHOR
271 Cory G Watson <gphat@cpan.org>
272
273 CONTRIBUTORS
274 Many thanks to the individuals who have contributed various bits:
275
276 Ash Berlin
277
278 Brian Cassidy
279
280 Guillermo Roditi
281
282 Torsten Schoenfeld
283
284 Yuval Kogman
285
286 SOURCE
287 Chart::Clicker is on github:
288
289 http://github.com/gphat/chart-clicker/tree/master
290
291 LICENSE
292 You can redistribute and/or modify this code under the same terms as
293 Perl itself.
294
+0
-50
example/markers.pl less more
0 #!/usr/bin/perl
1 use strict;
2
3 use Chart::Clicker;
4 use Chart::Clicker::Context;
5 use Chart::Clicker::Data::DataSet;
6 use Chart::Clicker::Data::Marker;
7 use Chart::Clicker::Data::Series;
8 use Geometry::Primitive::Rectangle;
9 use Graphics::Color::RGB;
10
11 my $cc = Chart::Clicker->new(width => 500, height => 400);
12
13 my $series1 = Chart::Clicker::Data::Series->new(
14 keys => [qw(1 2 3 4 5 6 7 8 9 10 11 12)],
15 values => [qw(5.8 5.0 4.9 4.8 4.5 4.25 3.5 2.9 2.5 1.8 .9 .8)]
16 );
17
18 my $ds = Chart::Clicker::Data::DataSet->new(series => [ $series1 ]);
19
20 $cc->add_to_datasets($ds);
21
22 my $domain_range_marker = Chart::Clicker::Data::Marker->new(key => 4, key2 => 6);
23 $domain_range_marker->inside_color(
24 Graphics::Color::RGB->new(red => 0, green => 0, blue => 0, alpha => .25)
25 );
26
27 my $domain_marker = Chart::Clicker::Data::Marker->new(key => 7);
28 $domain_marker->color(
29 Graphics::Color::RGB->new(red => 1, green => 0, blue => 0)
30 );
31
32 my $range_range_marker = Chart::Clicker::Data::Marker->new(value => 4, value2 => 5);
33 $range_range_marker->inside_color(
34 Graphics::Color::RGB->new(red => 0, green => 0, blue => 0, alpha => .25)
35 );
36
37 my $range_marker = Chart::Clicker::Data::Marker->new(value => 2);
38 $range_marker->color(
39 Graphics::Color::RGB->new(red => 1, green => 0, blue => 0)
40 );
41
42 my $defctx = $cc->get_context('default');
43
44 $defctx->add_marker($domain_range_marker);
45 $defctx->add_marker($range_range_marker);
46 $defctx->add_marker($range_marker);
47 $defctx->add_marker($domain_marker);
48
49 $cc->write_output('foo.png');
131131
132132 =head1 NAME
133133
134 Chart::Clicker::Axis::DateTime
134 Chart::Clicker::Axis::DateTime - An X or Y Axis using DateTime
135135
136136 =head1 DESCRIPTION
137137
1212 use Layout::Manager::Absolute;
1313
1414 use Math::Trig ':pi';
15
16 use Moose::Util::TypeConstraints;
17
18 type 'StrOrCodeRef' => where { (ref($_) eq "") || ref($_) eq 'CODE' };
1915
2016 has 'tick_label_angle' => (
2117 is => 'rw',
4541 })
4642 }
4743 );
48 has 'format' => ( is => 'rw', isa => 'StrOrCodeRef' );
44 has 'format' => ( is => 'rw', isa => 'Str|CodeRef' );
4945 has 'fudge_amount' => ( is => 'rw', isa => 'Num', default => 0 );
5046 has 'hidden' => ( is => 'rw', isa => 'Bool', default => 0 );
5147 has 'label' => ( is => 'rw', isa => 'Str' );
469465
470466 =head1 NAME
471467
472 Chart::Clicker::Axis
468 Chart::Clicker::Axis - An X or Y Axis
473469
474470 =head1 DESCRIPTION
475471
551547
552548 =head2 orientation
553549
554 The orientation of this axis. See L<Chart::Clicker::Drawing>.
550 The orientation of this axis. See L<Graphics::Primitive::Oriented>.
555551
556552 =head2 position
557553
1818
1919 =head1 NAME
2020
21 Chart::Clicker::Component
21 Chart::Clicker::Component - Base class that extends Graphics::Primitive::Component
2222
2323 =head1 DESCRIPTION
2424
1818
1919 =head1 NAME
2020
21 Chart::Clicker::Container
21 Chart::Clicker::Container - Base class that extends Graphics::Primitive::Container
2222
2323 =head1 DESCRIPTION
2424
6262
6363 =head1 NAME
6464
65 Chart::Clicker::Context
65 Chart::Clicker::Context - A rendering context: Axes, Markers and a Renderer
6666
6767 =head1 DESCRIPTION
6868
9696
9797 =head1 NAME
9898
99 Chart::Clicker::Data::DataSet
99 Chart::Clicker::Data::DataSet - A collection of series
100100
101101 =head1 DESCRIPTION
102102
4242
4343 =head1 NAME
4444
45 Chart::Clicker::Data::Marker
45 Chart::Clicker::Data::Marker - Highlight arbitrary value(s)
4646
4747 =head1 DESCRIPTION
4848
108108
109109 =head1 NAME
110110
111 Chart::Clicker::Data::Range
111 Chart::Clicker::Data::Range - A range of Data
112112
113113 =head1 DESCRIPTION
114114
5959
6060 =head1 NAME
6161
62 Chart::Clicker::Data::Series::HighLow
62 Chart::Clicker::Data::Series::HighLow - Series data with additional attributes for High-Low charts
6363
6464 =head1 DESCRIPTION
6565
5050
5151 =head1 NAME
5252
53 Chart::Clicker::Data::Series::Size
53 Chart::Clicker::Data::Series::Size - Chart data with additional attributes for Size charts
5454
5555 =head1 DESCRIPTION
5656
9090
9191 =head1 NAME
9292
93 Chart::Clicker::Data::Series
93 Chart::Clicker::Data::Series - A series of key, value pairs representing chart data
9494
9595 =head1 DESCRIPTION
9696
5252
5353 =head1 NAME
5454
55 Chart::Clicker::Decoration::Glass
55 Chart::Clicker::Decoration::Glass - Under-chart gradient decoration
5656
5757 =head1 DESCRIPTION
5858
113113
114114 =head1 NAME
115115
116 Chart::Clicker::Decoration::Grid
116 Chart::Clicker::Decoration::Grid - Under-data grid
117117
118118 =head1 DESCRIPTION
119119
146146
147147 =head1 NAME
148148
149 Chart::Clicker::Decoration::Legend::Tabular
149 Chart::Clicker::Decoration::Legend::Tabular - Tabular version of Legend
150150
151151 =head1 DESCRIPTION
152152
9191
9292 =head1 NAME
9393
94 Chart::Clicker::Decoration::Legend
94 Chart::Clicker::Decoration::Legend - Series name, color key
9595
9696 =head1 DESCRIPTION
9797
102102
103103 =head1 NAME
104104
105 Chart::Clicker::Decoration::MarkerOverlay
105 Chart::Clicker::Decoration::MarkerOverlay - Component for drawing markers
106106
107107 =head1 DESCRIPTION
108108
125125
126126 =head1 NAME
127127
128 Chart::Clicker::Decoration::OverAxis
128 Chart::Clicker::Decoration::OverAxis - An axis drawn over data
129129
130130 =head1 DESCRIPTION
131131
6666
6767 =head1 NAME
6868
69 Chart::Clicker::Decoration::Plot
69 Chart::Clicker::Decoration::Plot - Area on which renderers draw
7070
7171 =head1 DESCRIPTION
7272
1313
1414 =head1 NAME
1515
16 Chart::Clicker::Decoration
16 Chart::Clicker::Decoration - Shiny baubles!
1717
1818 =head1 DESCRIPTION
1919
118118
119119 =head1 NAME
120120
121 Chart::Clicker::Drawing::ColorAllocator
121 Chart::Clicker::Drawing::ColorAllocator - Color picker
122122
123123 =head1 DESCRIPTION
124124
132132
133133 =head1 NAME
134134
135 Chart::Clicker::Renderer::Area
135 Chart::Clicker::Renderer::Area - Area renderer
136136
137137 =head1 DESCRIPTION
138138
1212 is => 'rw',
1313 isa => 'Int',
1414 default => 0
15 );
16 has 'bar_width' => (
17 is => 'rw',
18 isa => 'Num',
19 predicate => 'has_bar_width'
1520 );
1621 has 'brush' => (
1722 is => 'rw',
6368 my $range = $ctx->range_axis;
6469
6570 my $owidth = $width - ($width * $domain->fudge_amount);
66 my $bwidth = int(($owidth / $self->{KEYCOUNT})) - $padding;
71 my $bwidth;
72 if($self->has_bar_width) {
73 $bwidth = $self->bar_width;
74 } else {
75 $bwidth = int(($owidth / $self->{KEYCOUNT})) - $padding;
76 }
6777 my $hbwidth = int($bwidth / 2);
6878
69 # Fudge amounts change mess up the calculation of bar widths, so
79 # Fudge amounts mess up the calculation of bar widths, so
7080 # we compensate for them here.
7181 my $cbwidth = $bwidth / $self->{SCOUNT};
7282 my $chbwidth = int($cbwidth / 2);
164174
165175 =head1 NAME
166176
167 Chart::Clicker::Renderer::Bar
177 Chart::Clicker::Renderer::Bar - Bar renderer
168178
169179 =head1 DESCRIPTION
170180
199209 How much padding to put around a bar. A padding of 4 will result in 2 pixels
200210 on each side.
201211
212 =head2 bar_width
213
214 Allows you to override the calculation that determines the optimal width for
215 bars. Be careful using this as it can making things look terrible. Note that
216 this number is divided evenly between all the values in a series when charting
217 multiple series.
218
202219 =head2 brush
203220
204221 Set/Get the Brush to use around each bar.
2020
2121 =head1 NAME
2222
23 Chart::Clicker::Renderer::Bubble
23 Chart::Clicker::Renderer::Bubble - Bubble render
2424
2525 =head1 DESCRIPTION
2626
147147
148148 =head1 NAME
149149
150 Chart::Clicker::Renderer::CandleStick
150 Chart::Clicker::Renderer::CandleStick - CandleStick renderer
151151
152152 =head1 DESCRIPTION
153153
181181
182182 =head1 NAME
183183
184 Chart::Clicker::Renderer::HeatMap
184 Chart::Clicker::Renderer::HeatMap - Work In Progress
185185
186186 =head1 DESCRIPTION
187187
140140
141141 =head1 NAME
142142
143 Chart::Clicker::Renderer::Line
143 Chart::Clicker::Renderer::Line - Line renderer
144144
145145 =head1 DESCRIPTION
146146
157157
158158 =head1 NAME
159159
160 Chart::Clicker::Renderer::Pie
160 Chart::Clicker::Renderer::Pie - Pie renderer
161161
162162 =head1 DESCRIPTION
163163
9292
9393 =head1 NAME
9494
95 Chart::Clicker::Renderer::Point
95 Chart::Clicker::Renderer::Point - Point renderer
9696
9797 =head1 DESCRIPTION
9898
107107 =head1 SYNOPSIS
108108
109109 my $pr = Chart::Clicker::Renderer::Point->new({
110 shape => Chart::Clicker::Shape::Arc->new({
110 shape => Geometry::Primitive::Arc->new({
111111 angle1 => 0,
112112 angle2 => 180,
113113 radius => 5
174174
175175 =head1 NAME
176176
177 Chart::Clicker::Renderer::PolarArea
177 Chart::Clicker::Renderer::PolarArea - Polar Area renderer
178178
179179 =head1 DESCRIPTION
180180
135135
136136 =head1 NAME
137137
138 Chart::Clicker::Renderer::StackedArea
138 Chart::Clicker::Renderer::StackedArea - Stacked Area renderer
139139
140140 =head1 DESCRIPTION
141141
1212 is => 'rw',
1313 isa => 'Int',
1414 default => 0
15 );
16 has 'bar_width' => (
17 is => 'rw',
18 isa => 'Num',
19 predicate => 'has_bar_width'
1520 );
1621 has 'brush' => (
1722 is => 'rw',
5964 my $strokewidth = $self->brush->width;
6065 $padding += $strokewidth;
6166
62 $self->{BWIDTH} = int(($width - ($width * $domain->fudge_amount)
63 - ($padding / 2 * $self->{KEYCOUNT})) / ($self->{KEYCOUNT}));
64 $self->{HBWIDTH} = $self->{BWIDTH} / 2;
67 my $bwidth;
68 if($self->has_bar_width) {
69 $bwidth = $self->bar_width;
70 } else {
71 $bwidth = int(($width - ($width * $domain->fudge_amount)
72 - ($padding / 2 * $self->{KEYCOUNT})) / ($self->{KEYCOUNT}));
73 }
74
75 my $hbwidth = $bwidth / 2;
6576
6677 # Fetch all the colors we'll need. Since we build each vertical bar from
6778 # top to bottom, we'll need to change colors vertically.
90101 my $y = $range->mark($height, $val);
91102 next unless defined($y);
92103
93 $self->move_to($x - $self->{HBWIDTH}, $height - $y + $self->brush->width * 2);
94 $self->rectangle($self->{BWIDTH}, $y - $accum - 1);
104 $self->move_to($x - $hbwidth, $height - $y + $self->brush->width * 2);
105 $self->rectangle($bwidth, $y - $accum - 1);
95106 # Accumulate the Y value, as it dictates how much we bump up the
96107 # next bar.
97108 $accum += $y - $accum;
134145
135146 =head1 NAME
136147
137 Chart::Clicker::Renderer::StackedBar
148 Chart::Clicker::Renderer::StackedBar - Stacked Bar renderer
138149
139150 =head1 DESCRIPTION
140151
157168 How much padding to put around a bar. A padding of 4 will result in 2 pixels
158169 on each side.
159170
171 =head2 bar_width
172
173 Allows you to override the calculation that determines the optimal width for
174 bars. Be careful using this as it can making things look terrible.
175
160176 =head2 brush
161177
162178 A stroke to use on each bar.
2121
2222 =head1 NAME
2323
24 Chart::Clicker::Renderer
24 Chart::Clicker::Renderer - Base class for renderers
2525
2626 =head1 DESCRIPTION
2727
2323 use Carp qw(croak);
2424 use Scalar::Util qw(refaddr);
2525
26 our $VERSION = '2.60';
26 our $VERSION = '2.62';
2727
2828 has '+background_color' => (
2929 default => sub {