ChartsOrg / ChartsOrg/Charts

Realtime Data chart refresh

Open
#2,859 14 comments 0 reactions 0 assignees View on GitHub
Good Example
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I'm using the `LineChartView` to display data that is continuously received (every 0.2 seconds usually, the time could change). My problem is : how do I refresh the chart correctly? At the moment, I have this code to reload :
```
lineChart.data?.notifyDataChanged()
lineChart.notifyDataSetChanged()
lineChart.animate(xAxisDuration: 0.01)
```
I'm using the `lineChart.animate(xAxisDuration: 0.01)` to redraw (refresh) the chart every time I receive new samples. The reload animation is not smooth and it happens using an animation, a workaround basically. How can I achieve the same effect, but in the correct way?

As you can see in issue number #2857 , the `invalidate()` method is missing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.