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.
  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Canada
    Posts
    19
    Vote Rating
    -1
    jtaekema is an unknown quantity at this point

      0  

    Default 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)

    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 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.

    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 ?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Canada
    Posts
    19
    Vote Rating
    -1
    jtaekema is an unknown quantity at this point

      0  

    Default


    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.

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Canada
    Posts
    19
    Vote Rating
    -1
    jtaekema is an unknown quantity at this point

      0  

    Default


    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?

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    dimitri valax is on a distinguished road

      0  

    Default Please help us ;)

    Please help us ;)


    I have the same problem!!!

    Do you get any solution for this issue?

    Regards.

    Dimitri.

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    dimitri valax is on a distinguished road

      0  

    Default


    Put a minimum to your axis. it works for me.
    Code:
    axis.setMinimum(0)]

  7. #7
    Sencha User
    Join Date
    Sep 2011
    Location
    Canada
    Posts
    19
    Vote Rating
    -1
    jtaekema is an unknown quantity at this point

      0  

    Default


    Unfortunately setting the minimum did not solve this issue for me.

  8. #8
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    dimitri valax is on a distinguished road

      0  

    Default


    Finally it doesn't work for me either...

    And i am supposed to deliver this feature next week

  9. #9
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    This has been fixed and will be in the release coming out this week.
    barmixed.PNG

  10. #10
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    dimitri valax is on a distinguished road

      0  

    Default


    Bravo