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

A way to add data to chart data entries in real time ? #609

Closed
ArEnSc opened this issue Dec 14, 2015 · 9 comments
Closed

A way to add data to chart data entries in real time ? #609

ArEnSc opened this issue Dec 14, 2015 · 9 comments

Comments

@ArEnSc
Copy link

ArEnSc commented Dec 14, 2015

Does iOS Charts work with real time data? I couldn't find the answer anywhere, I searched the git issues no mention of it.

@sergstav
Copy link

You maybe want to update your datasource for chartview.

@ArEnSc
Copy link
Author

ArEnSc commented Dec 14, 2015

can you give me a quick sample ? in objective-c

@sergstav
Copy link

Can you describe want you want to achieve in details please?

@ArEnSc
Copy link
Author

ArEnSc commented Dec 14, 2015

I have a line chart,
I have the acceleromitor and I want to plot x as time in miliseconds, and I want to plot y as an acceleromitor value.
I want it to update the graph every time new data comes in from the accleromitor ? can this library reliabily chart this ?

@sergstav
Copy link

Can you try [_chartView notifyDataSetChanged] every time new data comes?

@ArEnSc
Copy link
Author

ArEnSc commented Dec 14, 2015

Alright ill take a look at that, I suppose I just change the chart.data then call that function ?

@sergstav
Copy link

I think that this function triggers redraw chart with data in arrays. So if you have new data, then new data will be in chart

@liuxuan30
Copy link
Member

try search issues, there are some answers alerady, with some APIs, like addEntry, addDataSet, moveViewToX, etc.

Setting data will trigger notifyDataSetChanged if not empty.

Be aware that there might be performance drop if you add huge amount of values in a very short time. There is some people asked they will add many values in one second.

@acegreen
Copy link

acegreen commented Mar 8, 2017

@liuxuan30 does adding an entry, actually draw it on the chart? or do we need to call something to redraw?

clarification: I do .addEntry(_) on my dataSet but nothing happens on the chart itself. When I force call notifyDataSetChanged(), the data is updated but it "blink". That means the data is reset

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

4 participants