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

Real time line chart #142

Closed
yuchuqiao opened this issue Jun 10, 2015 · 6 comments
Closed

Real time line chart #142

yuchuqiao opened this issue Jun 10, 2015 · 6 comments

Comments

@yuchuqiao
Copy link

hi,

Anyone successfully implement a realtime line chart ? Some example to give ? I tried several ways, like: call notifyDatasetChanged() and reloadInputViews. But that makes the chart completely messed up.

Thanks.

@danielgindi
Copy link
Collaborator

You mean for adding data in realtime?

@knseir
Copy link

knseir commented Jun 13, 2015

Hi Daniel, glad I found this issue.
I'm also trying to add data in realtime. I have a heart rate monitor that sends a heart rate at irregular intervals. every time it does, I call a function that ends with :

        chart.notifyDataSetChanged()

Only the chart doesn't change until it gets about 5-7 new datapoint

I know they're not all coming together because I can see them on the console.
I get point 1, 2, 3, ... 7 THEN the chart changes

is there something similar to chart.invalidate ?

@knseir
Copy link

knseir commented Jun 13, 2015

UPDATE:

it turns out that the graph was updated automatically. I notices this when I swiped to the right and it showed the new values. However, I had to keep swiping to see them

even

    chart.setVisibleXRangeMaximum(20)
    chart.moveViewToX(data!.xValCount - 21)

did not move the graph to the new points

@sunjames
Copy link

Ios - charts can mix after release

@knseir
Copy link

knseir commented Jun 16, 2015

Hi sunjames, I'm sorry, I don't understand
'charts can mix after release' ?

@danielgindi
Copy link
Collaborator

the moveViewToX function was fixed, so you should be able to control it in whatever way you like now.

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