r57720 - in /branches/upstream/libchart-clicker-perl/current: Changes META.yml lib/Chart/Clicker.pm lib/Chart/Clicker/Data/DataSet.pm lib/Chart/Clicker/Renderer/StackedBar.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sun May 9 04:57:37 UTC 2010
Author: jawnsy-guest
Date: Sun May 9 04:57:31 2010
New Revision: 57720
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57720
Log:
[svn-upgrade] Integrating new upstream version, libchart-clicker-perl (2.63)
Modified:
branches/upstream/libchart-clicker-perl/current/Changes
branches/upstream/libchart-clicker-perl/current/META.yml
branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm
branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Data/DataSet.pm
branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/StackedBar.pm
Modified: branches/upstream/libchart-clicker-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/Changes?rev=57720&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/Changes (original)
+++ branches/upstream/libchart-clicker-perl/current/Changes Sun May 9 04:57:31 2010
@@ -1,4 +1,8 @@
Revision history for Perl extension Chart::Clicker.
+
+2.63
+ - Make DataSet and StackedBar more tolerant of missing values (Rod Taylor,
+ RT #57259)
2.62
- More POD fixes
Modified: branches/upstream/libchart-clicker-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/META.yml?rev=57720&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/META.yml (original)
+++ branches/upstream/libchart-clicker-perl/current/META.yml Sun May 9 04:57:31 2010
@@ -39,4 +39,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: http://github.com/gphat/chart-clicker
-version: 2.62
+version: 2.63
Modified: branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm?rev=57720&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm (original)
+++ branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm Sun May 9 04:57:31 2010
@@ -24,7 +24,7 @@
use Carp qw(croak);
use Scalar::Util qw(refaddr);
-our $VERSION = '2.62';
+our $VERSION = '2.63';
has '+background_color' => (
default => sub {
@@ -152,6 +152,12 @@
Chart::Clicker::Decoration::Plot->new
}
);
+has 'subgraphs' => (
+ is => 'rw',
+ isa => 'ArrayRef',
+ default => sub { [] },
+ predicate => 'has_subgraphs'
+);
has 'title' => (
is => 'rw',
isa => 'Graphics::Primitive::TextBox',
@@ -178,6 +184,15 @@
croak("Context named '".$ctx->name."' already exists.");
}
$self->set_context($ctx->name, $ctx);
+}
+
+sub add_subgraph {
+ my ($self, $graph) = @_;
+
+ if (not ref $graph or not $graph->isa('Chart::Clicker')) {
+ die('Sub-Graphs must be Chart::Clicker objects');
+ }
+ push(@{$self->subgraphs}, $graph);
}
sub data {
@@ -277,6 +292,16 @@
$self->add_component($self->legend, $self->legend_position);
}
+ # Add subgraphs
+ if($self->has_subgraphs) {
+ for my $subgraph (@{$self->subgraphs}) {
+ $subgraph->border->width(0);
+ $subgraph->padding(0);
+
+ $self->add_component($subgraph, 'south');
+ }
+ }
+
if(defined($self->title->text)) {
my $tp = $self->title_position;
if(($tp =~ /^e/) || ($tp =~ /^w/)) {
@@ -693,6 +718,12 @@
You probably want to set the grid's background color to an alpha of 0 if you
enable this flag.
+=head2 subgraphs
+
+You can add "child" graphs to this one via C<add_subgraph>. These must be
+Chart::Clicker objects and they will be added to the bottom of the existing
+chart. This is a rather esoteric feature.
+
=head2 title
Set/Get the title component for this chart. This is a
@@ -777,6 +808,10 @@
Add the specified marker to the chart.
+=head2 add_subgraph
+
+Add a subgraph to this chart.
+
=head2 color_allocator
Set/Get the color_allocator for this chart.
Modified: branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Data/DataSet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Data/DataSet.pm?rev=57720&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Data/DataSet.pm (original)
+++ branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Data/DataSet.pm Sun May 9 04:57:31 2010
@@ -31,6 +31,16 @@
}
);
+sub get_all_series_keys {
+ my ($self) = @_;
+
+ my %keys;
+ for my $series (@{$self->series}) {
+ foreach (@{$series->keys}) { $keys{$_} = 1};
+ }
+ return keys %keys;
+}
+
sub get_series_keys {
my ($self, $position) = @_;
@@ -53,7 +63,7 @@
# Check that value against all the remaining slices
for my $i (0 .. $self->max_key_count - 1) {
my $t;
- foreach ($self->get_series_values($i)) { $t += $_; }
+ foreach ($self->get_series_values($i)) { $t += $_ if defined($_); }
$big = $t if(($t > $big) || !defined($big));
}
return $big;
@@ -158,6 +168,10 @@
Get the number of series in this dataset.
+=head2 get_all_series keys
+
+Returns an array of keys representing the union of all keys from all DataSets.
+
=head2 get_series_keys
Returns the key at the specified position for every series in this DataSet.
Modified: branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/StackedBar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/StackedBar.pm?rev=57720&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/StackedBar.pm (original)
+++ branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/StackedBar.pm Sun May 9 04:57:31 2010
@@ -81,7 +81,7 @@
push(@{ $self->{COLORS} }, $clicker->color_allocator->next);
}
- my @keys = @{ $dses->[0]->get_series(0)->keys };
+ my @keys = $dses->[0]->get_all_series_keys;
# Iterate over each key...
for (my $i = 0; $i < scalar(@keys); $i++) {
@@ -98,7 +98,7 @@
my $val = 0;
for my $j (0 .. $#values) {
- $val += $values[$j];
+ $val += $values[$j] if defined($values[$j]);
my $y = $range->mark($height, $val);
next unless defined($y);
More information about the Pkg-perl-cvs-commits
mailing list