You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 2, 2020. It is now read-only.
BEMLine quadCurvedPathWithPoints: results in index 0 beyond bounds for empty array #271
A workaround hack: If I change line 157 in BEMLine.m from this: if (!self.disableMainLine && self.bezierCurveIsEnabled) {
to this: if (!self.disableMainLine && self.bezierCurveIsEnabled && self.points.count && self.bottomPointsArray.count && self.topPointsArray.count) {
it works OK.
This points to an apparent problem with my data array being empty, I think, although that shouldn't be the case. Is there some better way to avoid having BEMLine trying to draw with an empty data set?
I really appreciate using BEMSimpleLineGraph. Thanks for any help.
thanks @carleihar - yes same for me if array only contains null values and then my code returns BEMNullGraphValue in the - (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph valueForPointAtIndex:(NSInteger)index method. I'm adding a zero value to the beginning of all of my data arrays to get around this for now. Have you found any other solution?
@sjmn Right now I am checking to see if my points array is empty, and if it is just removing the graph from the superview. Definitely not a pretty solution but it works.
Activity
Sam-Spencer commentedon Oct 19, 2016
Hi @sjmn, I'll look into this and get back to you. Could you provide some details on how exactly to replicate the issue?
sjmn commentedon Nov 7, 2016
@Sam-Spencer the problem seems to have resolved itself - I'm now not sure how to replicate - thanks.
carleihar commentedon Nov 28, 2016
@Sam-Spencer I'm replicating by returning
BEMNullGraphValuefor all my data points, which for me may happen before I'm finished fetching data.sjmn commentedon Dec 1, 2016
thanks @carleihar - yes same for me if array only contains null values and then my code returns BEMNullGraphValue in the
- (CGFloat)lineGraph:(BEMSimpleLineGraphView *)graph valueForPointAtIndex:(NSInteger)indexmethod. I'm adding a zero value to the beginning of all of my data arrays to get around this for now. Have you found any other solution?carleihar commentedon Dec 5, 2016
@sjmn Right now I am checking to see if my points array is empty, and if it is just removing the graph from the superview. Definitely not a pretty solution but it works.