Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.
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

Open

Description

@sjmn

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.

Activity

  1. Sam-Spencer commented on Oct 19, 2016

    @Sam-Spencer
    Collaborator

    Hi @sjmn, I'll look into this and get back to you. Could you provide some details on how exactly to replicate the issue?

  2. sjmn commented on Nov 7, 2016

    @sjmn
    Author

    @Sam-Spencer the problem seems to have resolved itself - I'm now not sure how to replicate - thanks.

  3. carleihar commented on Nov 28, 2016

    @carleihar

    @Sam-Spencer I'm replicating by returning BEMNullGraphValue for all my data points, which for me may happen before I'm finished fetching data.

  4. sjmn commented on Dec 1, 2016

    @sjmn
    Author

    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?

  5. carleihar commented on Dec 5, 2016

    @carleihar

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions