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

Core Data interfacing? #15

Closed
dxclancy opened this issue Apr 9, 2015 · 11 comments
Closed

Core Data interfacing? #15

dxclancy opened this issue Apr 9, 2015 · 11 comments

Comments

@dxclancy
Copy link

dxclancy commented Apr 9, 2015

This looks great. Is there support for interfacing with core data such that not all data needs to be pushed into the chart but can be pulled as needed?

Perhaps you could point me to the proper API.

Thanks!

@MaxHasADHD
Copy link

I would be interested in this as well

@liuxuan30
Copy link
Member

I am not sure if I understand correctly, but I think charting is just how you draw the lines and shapes, they have no knowledge and shouldn't have as well where your data comes from. It's every controller's work to fetch the data needed and feed the chart library.

@danielgindi
Copy link
Collaborator

@liuxuan30 that's correct. I can't imagine a situation where you would want the chart to pull data from Core Data or any other.

But maybe one of these guys can explain the source for the need.

Maybe you require some sort of a "virtual chart" where you want a scrollable chart that "pulls" the data through a delegate as you scroll? (Even then it's a complicated issue, as the chart needs to know how many values there are so it knows how much scrolling, similarly to UITableView, and you would need to use customMinY/customMaxY as well)

@dxclancy
Copy link
Author

Correct. UITableView is analgous, in that you can use it to pull data from a source versus pushing all the data into it. NSFetchedResultsController is an example of how you can bind a uitableview datasource to a core data query. Knowing how many values there are is not an issue. This is knowable via a query as well.

When mentioning core data above, i wasn't saying it should be directly interfacing with it. As an example I'm saying a typical source of data on iOS IS core data, and as such you may be pulling data from a large database which you'd rather not populate the entire data from. This will be a common use pattern for some clients of these charts.

I believe Core Plot handles this via binding to NSArrayController interfaces which in turn you can bind to Core data. I'm not overly familiar with Core Plot because seeing this library has diverted my attention from it!

I was just being a bit lazy and wondering if IOSCharts has a similar ability already built in, and if you could point me at it instead of me casting about for it. :)

Thanks!

@dxclancy
Copy link
Author

I took a quick look at the StackedBarChart. It looks like to me that chart views require a ChartData object which is essentially all the various data packed up. So my guess would be there isn't currently support for a UITableViewDataSource like interface for lazily pulling data.

@danielgindi
Copy link
Collaborator

Currently there's no such support- but I'll try to design something asap :)

@danielgindi
Copy link
Collaborator

There's support for dynamic interfaces for a while now. Anyone can bind to core data or any other data source, and there was no activity on this post for quite a while now, so I'll consider this as resolved.

@dxclancy
Copy link
Author

dxclancy commented Mar 2, 2016

Can you point to the appropriate class?

@liuxuan30
Copy link
Member

@dxclancy check out the data interfaces and the realm data implementations for reference

@dxclancy
Copy link
Author

dxclancy commented Apr 5, 2016

So I'm looking at the realm demo, specifically Real Line Chart. It gets all the data in the database and sets it all at once. This doesn't seem to be an example of the type this issue raised. ?

@liuxuan30
Copy link
Member

@dxclancy this is an old issue, but Daniel closed it because we now have interaces for CoreData, that's the title of this issue, and it can be closed, right?
Right now the design is the chart will draw whatever you feed in. you give N data, it draw N line dots.
Chart only read data from data sets, and it's your freedom to put whatever data is into the set.

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

No branches or pull requests

4 participants