Le Ven 25 Juin 2010 13:10:50, rtaylor a écrit :
Show quoted text> On Wed Jun 16 12:40:02 2010, ngreen wrote:
> > On Tue May 11 08:50:25 2010, rtaylor wrote:
> > > With small test data sets it just, coincidentally, worked . Large
> > > datasets need to be sorted.
> >
> > Assuming the symptom seen was stackedbar charts' data being out of
order,
Show quoted text> > I think the bug is really with accessing the series values (the
value
Show quoted text> > passed to get_series_values needs to match the one passed to mark).
> > Sorting the datasets might still be useful for other reasons though.
>
> Indeed. The issue is that the values are out of order. The issue is
that
Show quoted text> get_all_series_keys makes a hash to determine distinct values in all
> sets, then takes an array from that which changes the order from the
> specified values.
>
> Another option might be to use a merge mechanism (iterate through each
> series and merge lowest values) but this also requires the concept of
order.
Hi,
I encounter the same issue, and here's what I did (attached). Please
bear with my bad coding, i'm just beginning :)
I also think that the issue comes from get_series_values, so I created
another function in DataSet.pm, named get_series_values_by_key, that I
call from StackedBar.pm. (The name of this function is self
explanatory :)) It helps me, because I had to be sure that the stacked
elements had the same key, because all my series in my DataSet have
neither the same length nor the same keys, so I ended up with all the
nth elements stacked, even when the nth element of serie1 hasn't the
same key as the nth element of serie2. (that's why I don't think
ordering get_all_series_keys will solve my issue)
I encounter another issue very similar to this one so I just add it
here.
It's with the value returned by largest_value_slice(). The value is not
always the largest slice, because it sums values that haven't the same
key. For instance if my series are serie1 = { '2010' => 1, '2009' => 2}
and serie2 = {'2009' => 4, '2008' => 3}, I get a largest slice value
equal to serie1[0]+serie2[0] = 5, when I should get 6 (2+4).
So I came up with the same solution as above : use of
get_series_values_by_key (see the end of "dataset.diff").
I hope I'm not completely wrong !
Sorry if my explanations weren't very clear, I did my best :(.
Cheers,
Marc