Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVG-TT-Graph CPAN distribution.

Report information
The Basics
Id: 18127
Status: resolved
Priority: 0/
Queue: SVG-TT-Graph

People
Owner: Nobody in particular
Requestors: yanick+cpan [...] babyl.dyndns.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09
Fixed in: (no value)



Subject: Fields with same name are losing their data
If there are two or more fields with the same value, their data will be messed up. From what I can see, it comes from the data being stored in hashes. I'm included a short script demonstrating the bug.
Subject: bug.pl
#!/usr/bin/perl use SVG::TT::Graph::Line; my $graph = SVG::TT::Graph::Line->new({ 'fields' => [qw/ a b b b c /], }); $graph->add_data({ 'data' => [ 1..5 ] }); print $graph->burn();
Hi, "If there are two or more fields with the same value" I think you mean fields with the same 'name', not the same 'value'. As it is I don't see this as a bug - if you are graphing data why would you have two fields with the same name, either they are the same (and should be a single field), or they are different (and should have distinct names)? Cheers Leo
CC: YANICK [...] cpan.org
Subject: Re: [rt.cpan.org #18127] Fields with same name are losing their data
Date: Sun, 12 Mar 2006 20:20:40 -0500
To: bug-SVG-TT-Graph [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=18127 > > > > As it is I don't see this as a bug - if you are graphing data why would you have two fields with > the same name, either they are the same (and should be a single field), or they are different > (and should have distinct names)? >
In my case, I had a bar graph with 30 entries (I'm plotting a metric in function of the release number of a module). As the number of bars is high, putting all the X labels 0.0, 0.1, 0.2, ... 0.9, 1.0, 1.1, ... produces a fairly busy graph. So what I decided to do instead was to display only the major version numbers by doing something like: my @fields = ( 0.0, 0.1, 0.2, 0.3, ..., 0.9, 1.0, 1.1, ... and so on and so forth ); my $graph = SVG::TT::Graph::Bar->new({ fields => [ map { $_ == int $_ ? $_ : '' } @fields ] , }); Which, alas, doesn't work because all data entries with an empty strings are collapsed into a single value. This being said, I found a workaround. What I do now is simply to give a temporary name to the fields I want to be blank an then remove them afterwards (using Inkscape, or potentially XML::XPathScript).