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 Premium Member
    Join Date
    Apr 2012
    Posts
    5
    Vote Rating
    0
    tombrayca is on a distinguished road

      0  

    Default BarSeries.drawLabels() doesn't account for multiple yFields, throws NPEs

    BarSeries.drawLabels() doesn't account for multiple yFields, throws NPEs


    I have a BarSeries with 2 yFields and a labelConfig. My store has 9 items, so with two yFields that means there are 18 rects drawn. BarSeries.calculatePaths() has logic that alternates between the two fields for each of the 9 items. BarSeries.drawLabels(), however, does not -- it uses the number of rects to try to get the labels, so it's inaccurate and throws an exception once you exceed the store's bounds.

    You should be able to reproduce this by adding a labelConfig to your grouped barchart example.

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    5
    Vote Rating
    0
    tombrayca is on a distinguished road

      0  

    Default found a workaround

    found a workaround


    BarSeries should override setLabelText. In the meantime, here's my workaround (the difference is the call to getStoreIndex):

    public class MyOtherBarSeries<M> extends BarSeries<M>
    {
    @Override
    protected void setLabelText(Sprite sprite, int index) {
    if (sprite instanceof TextSprite) {
    TextSprite text = (TextSprite) sprite;
    if (labelConfig.getLabelProvider() != null) {
    text.setText(labelConfig.getLabelProvider().getLabel(chart.getCurrentStore().get(getStoreIndex(index)),
    getValueProvider(index)));
    }
    }
    }
    }

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

      0  

    Default


    Thanks for bringing this to my attention. This has now been fixed and will be in the next release.

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

      0  

    Default


    GXT 3.0.1 has been released and contains this fix.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar