Menu

#40 getBounds() entries return null after a bar with height 0

v0.9.0
closed-fixed
nobody
None
3
2016-02-12
2015-11-30
No

I'm creating a bar chart series where some bars have height 0. This causes the getBounds() method on IBarSeries to return null for all bar entries in the array after the bar entry that has height 0. This is due the following lines in BarSeries:
...
for (int i = 0; i < xSeries.length; i++) {
if (cnt < comporessedXSeries.length
&& comporessedXSeries[cnt] == xSeries[i]
&& compressedBounds[cnt].width != 0
&& compressedBounds[cnt].height != 0) {
rs[i] = compressedBounds[cnt++];
}
}
...

Once one of the conditions is false the cnt is not incremented anymore (see cnt++ in if clause) and rs is not filled at the following indexes.

I added a patch with a fix (BarSeries.java.patch) that works in my use case. Please have look and let me know if this is ok.

I provided also an example to demonstarte the problem (BarBoundsExample.java). Run this example and hover over the bars right beside the one that have height 0 and for these beside the tooltip is not shown due to the error above.

Thanks
Bernd

1 Attachments

Discussion

  • Bernd Hufmann

    Bernd Hufmann - 2016-01-08

    Any news when this bug is being fixed. This bug prevents me to upgrade to 0.9.0.

    Please let me know

    Thanks
    Bernd

     
  • yoshitaka

    yoshitaka - 2016-02-12
    • status: open --> closed-fixed
     
  • yoshitaka

    yoshitaka - 2016-02-12

    fixed in 0.10.0