Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Previously Drawn Graph Lines Without Reallocated (Programmatic Allocation) #8

Closed
JudeMurphy opened this issue Jan 25, 2016 · 0 comments

Comments

@JudeMurphy
Copy link

Hey guys! I have to first say, this is a GREAT and easy-to-use custom class. A job well done!

One issue I had with it though. When programmatically defining a JYGraphView, and throwing it into a ViewDidLoad, I didn't want to reallocate my instance every time to remove the previously drawn lines with the updated Graph Data. So I created this method inside of JYGraphView. I was going to make a pull request, but I found out this was a private repo. So, here's the code. Figured anyone else that ran into the same problem could use it too:

// Used to clear previously drawn sublayers, or lines, and replots graph
// Be sure to update your JYGraphView's graphData and graphDataLabels before calling this

  • (void)redrawGraphAfterUpdatingGraphData
    {
    [[self layer] setSublayers: nil];
    [self plotGraphData];
    }

Feel free to add this to your repo for JYGraphView!

screen shot 2016-01-25 at 6 46 06 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant