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
Unusably slow with many data points #75
Comments
Probably worth having a debounce period configurable. edit: nevermind, tried this and it was more 'performant' but perception of its performance is just as bad. |
For this reason we switched to use: http://dygraphs.com/ |
I figured out some method to increase the performance for chart-js. All of the points are always rendered, even if they are not visible (e.a. outside of the current view). I made a plugin that only puts the data that is currently visible into the datasets and keep a seperate object with all the data. Here is the plugin I made (for time series only). How to use it: create a 'allData' array in your chart data object in which you nest one array for each dataset. Put all the data in this array (best to use an array of objects like {x: .., y: ..}) and only the data will be put in the actual dataset that is visible. Feel free to adapt it to other use cases. I used this for updating graphs to be able to keep some sort of history to which you can pan, but not keep this extra data lagging my graph.
|
@Evertvdw do you think there's a performance bug in the main Chart.js repo related to the handling of points not being rendered? If so, it would be great to file a bug there with details |
@benmccann There is definitely a bug in the main Charts.js repo. Current approach is to fade out clipped points by applying an alpha, rather than not rendering them:
The last three lines are an unnecessary expense for points with |
This looks like an issue mostly in the main chart.js code. Now that Chart.js is at v3, there are more solutions to this:
|
@Evertvdw Just to let you know I made a Chart.js plugin inspired by your code which solves the performance problems, which might help in case anyone else is having this issue (which still happens on the latest Chart.js and plugin version). https://github.com/Pecacheu/chartjs-filter-plugin |
Hello,
I have a question regarding zooming with large amounts of data. I currently have a graph with >20k points in it and the zooming functionality in that is pretty much useless, as it is to slow.
A possible solution I thought of is to update the points of the graph only when the dragging or zooming ends, to keep it usable. Is there a way to seperate the update of the datasets and of the axis in the charts? That way you can zoom and see what your doing on the axis and after you finish dragging call the update method of the chart.
Any suggestions here? I'm trying to make charts work with a lot of data, any help is appreciated!
Thanks!
The text was updated successfully, but these errors were encountered: