-
20 Jul 2012 10:41 PM #1
Bad AsssertionError "Cannot mix positive and negative values in BarSeries"
Bad AsssertionError "Cannot mix positive and negative values in BarSeries"
Unfortunately this assert does not seem to work as expected and causes errors (in dev mode)
In my chart I have fairly large (Long) values, this conversion to a double and then multiplication seems to result in this assertion error even when there are no negative values in the data.Code:public class BarSeries<M> extends MultipleColorSeries<M> { private void calculatePaths() { ... double value = yFields.get(j).getValue(store.get(i)).doubleValue(); assert value * minY >= 0 : "Cannot mix positive and negative values in BarSeries."; ... } }
In my data I see values ranging between 0 and 5587930998, could it also be because I sometimes have a chart full of 0's ?
-
21 Jul 2012 3:23 PM #2
Appears to be the same issue expressed as http://www.sencha.com/forum/showthread.php?211228 - As of 3.0.0, the BarSeries cannot handle both positive and negative values. From that assertion, either value is negative, or minY is, which isn't permitted (since both being negative indicates that all bars are negative, and both positive means all are positive). Set a breakpoint on all AssertionErrors and check which value it is that is wrong - there may be a bug in how this assertion is checked, but it seems more likely that some value is negative, or that the minY value has been set too low through some other configuration.
-
23 Jul 2012 4:11 PM #3
minY is NaN which is causing this assertion to fail. I never set a min or max size for the axis.
Also this only occurs when every item in the data store returns 0 for the bar value. If one or more item in the data store has a non-zero value this error doesn't occur.
-
23 Jul 2012 6:38 PM #4
Further debugging shows that the from and to fields for the numeric axis are calculated before there is anything in the data store, which is causing them to be set to NaN. Then went the chart is rendered the minY and maxY are NaN causing this assertion to fail.
What is the recommended way to deal with this?
-
25 Jul 2012 5:59 AM #5
Please help us ;)
Please help us ;)
I have the same problem!!!
Do you get any solution for this issue?
Regards.
Dimitri.
-
26 Jul 2012 12:54 AM #6
Put a minimum to your axis. it works for me.
Code:axis.setMinimum(0)]
-
26 Jul 2012 3:18 PM #7
Unfortunately setting the minimum did not solve this issue for me.
-
27 Jul 2012 12:56 AM #8
Finally it doesn't work for me either...
And i am supposed to deliver this feature next week
-
31 Jul 2012 10:26 AM #9
-
31 Jul 2012 11:04 PM #10
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote