Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    7
    Vote Rating
    0
    mailisa is on a distinguished road

      0  

    Default yField null data

    yField null data


    Something similar to your issue is that I believe a NPE is thrown when there is a null yField value. So for instance, in the stacked bar charts Movies example, if you change to code to for getMovie to:

    Code:
    public List<Movies> getMovieData(int firstYear, int size, double min, double scale) {
                List<Movies> movies = new ArrayList<Movies>();
                for (int i = 0; i < size; i++) {
                    if (i %3 == 0) {
                        movies.add(new Movies(firstYear + i, Math.floor(Math.max(Math.random() * scale, min)), Math.floor(Math.max(Math.random() * scale, min)),
                                Math.floor(Math.max(Math.random() * scale, min)), Math.floor(Math.max(Math.random() * scale, min))));
                    }
                    else {
    
                        movies.add(new Movies(firstYear + i, Math.floor(Math.max(Math.random() * scale, min)), Math.floor(Math.max(Math.random() * scale, min)),
                                Math.floor(Math.max(Math.random() * scale, min)), null));
                    }                  
                }
                return movies;
              }
    Where the values have been changed from double -> Double. I don't think your workaround would fix it in this case (and I haven't found one myself - I don't know if I'm doing it wrong, but the charts don't seem to work too well with null field values and ignoring them).

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

      0  

    Default


    I moved this post into its own thread because it is a completely different issue. For some series types it does make sense for it to do something with null or NaN. However, bar series not so much. It could be argued that it should be interpreted as 0, but I think it is better to leave that up to the developer on the store side.

Thread Participants: 1