Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Chart-Clicker CPAN distribution.

Report information
The Basics
Id: 57259
Status: resolved
Priority: 0/
Queue: Chart-Clicker

People
Owner: Nobody in particular
Requestors: rod.taylor [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.62
Fixed in: (no value)



Subject: Warnings in Stacked Bar chart
Download (untitled) / with headers
text/plain 812b
When graphing a sparse data-set where domain keys do not fully overlap warnings are thrown. This suppresses the warnings. *** /usr/local/lib/perl5/site_perl/5.10.1/Chart/Clicker/Renderer/StackedBar.pm.orig 2010-05-06 09:18:12.000000000 -0400 --- /usr/local/lib/perl5/site_perl/5.10.1/Chart/Clicker/Renderer/StackedBar.pm 2010-05-06 09:19:04.000000000 -0400 *************** *** 98,104 **** my $val = 0; for my $j (0 .. $#values) { ! $val += $values[$j]; my $y = $range->mark($height, $val); next unless defined($y); --- 98,104 ---- my $val = 0; for my $j (0 .. $#values) { ! $val += $values[$j] if (defined $values[$j]); my $y = $range->mark($height, $val); next unless defined($y);
From: rod.taylor [...] gmail.com
Download (untitled) / with headers
text/plain 788b
Another undefined error when graphing sparse datasets on a stacked bar chart. *** DataSet.pm.orig 2010-05-06 11:51:13.000000000 -0400 --- DataSet.pm 2010-05-06 11:53:08.000000000 -0400 *************** *** 53,59 **** # 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 += $_; } $big = $t if(($t > $big) || !defined($big)); } return $big; --- 53,59 ---- # 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 += $_ if (defined $_); } $big = $t if(($t > $big) || !defined($big)); } return $big;
From: rod.taylor [...] gmail.com
Download (untitled) / with headers
text/plain 1.2k
Related to the two above patches, though this doesn't fix warnings. The render method was skipping bars for keys not in the first data series. Instead, it should find all keys for all data sets and treat the value as 0 for undefined datums. *** Data/DataSet.pm.orig 2010-05-06 12:07:52.000000000 -0400 --- Data/DataSet.pm 2010-05-06 12:20:46.000000000 -0400 *************** *** 31,36 **** --- 31,48 ---- } ); + 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) = @_; *** Renderer/StackedBar.pm.orig 2010-05-06 12:02:38.000000000 -0400 --- Renderer/StackedBar.pm 2010-05-06 12:12:07.000000000 -0400 *************** *** 81,87 **** push(@{ $self->{COLORS} }, $clicker->color_allocator->next); } ! my @keys = @{ $dses->[0]->get_series(0)->keys }; # Iterate over each key... for (my $i = 0; $i < scalar(@keys); $i++) { --- 81,87 ---- push(@{ $self->{COLORS} }, $clicker->color_allocator->next); } ! my @keys = $dses->[0]->get_all_series_keys; # Iterate over each key... for (my $i = 0; $i < scalar(@keys); $i++) {
Fixed in pending release. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.