Menu

#35 enableLogScale fails on empty series

v0.8.0
closed-fixed
nobody
None
5
2014-02-19
2013-11-13
No

Series#setXSeries and setYSeries don't update their range bounds when passed an empty double[]. This causes a failure in the following scenario:

  1. I am displaying a chart with several line series, on a linear scale. These series may contain zero data points;
  2. I want to switch over to different, strictly positive series, on a log scale;
  3. but I change the series one by one and each time I call enableLogScale;
  4. and this fails because some series are still old and have zero data;
  5. so I set all series to empty beforehand;
  6. but it still fails because the ranges were not recalculated;
  7. so I must set a dummy series with a single positive value, which is then erroneously displayed for a short time.

On a side note, the exception message says

Series contain negative value.

which is misleading: my data is supposed to never contain negative values, so I thought I had a bug in my data-generating code, only to find out that the true meaning of the message is

Series contain non-positive value.

Discussion

  • yoshitaka

    yoshitaka - 2013-11-19

    The implementation of IAxis.enableLogScale(boolean) has been changed to correctly check the content of series.

     
  • yoshitaka

    yoshitaka - 2013-11-19
    • status: open --> pending
     
  • yoshitaka

    yoshitaka - 2014-02-19
    • Status: pending --> closed-fixed
     
MongoDB Logo MongoDB