-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Dynamic graph display #445
Comments
With your numbers, it means 22,500 data entries after 3 minutes. That will definitely draw slower. |
Hi @danielgindi, thanks for this. I've already tried the approach you have mentioned, and as expected, there was a significant improvement in the performance. I was wondering maybe it would be of value to include this as a note in the docs regarding dynamic drawing? |
I've got the exactly same function, update LineChartView about 100 times/second. But my problems is the graph seems not to update apparently, Could you point me out what's wrong with this? what is my mistake? -> these lines of code will be call 100 times/sec if index > MAX_XVALS { let entryData = ChartDataEntry(value: arc4random_uniform(1000) + 1, xIndex: index!) self.lineChartView.notifyDataSetChanged() Thank you. |
@tulm00073 would you just check if the drawRect is called and the data you are sure it's updated. Calling notifyDataSetChanged eventually will invoke setNeedsDisplay, so there should be a redraw of your line chart. You can debug from there. |
Hi, I am using your library and use addEntry function to add data on the graph. The adding rate is about 80Hz, so 125 points per second. I set 400 points display on the window and remove entry outside window.
During the test on iPad mini, the whole app will be slower and slower after about 3 minutes. Maybe the library efficiency could be improved.
The text was updated successfully, but these errors were encountered: