-
Notifications
You must be signed in to change notification settings - Fork 108
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
How do I actually "append" a point to Highcharts.series? #51
Comments
Hi @ritou11 Currently only chart.update is used, so if you require an advanced solution then you could try using Highcharts without the wrapper and call API functions that will work best for your chart performance. Internal note: |
@KacperMadej are we able to access the chart directly via reft? Like the example here: |
Hi @ldelossa, Yes, you can access directly the chart by refs, for example in this way:
Best regards! |
If I wanted to extend the above concept to live updating data, do you have any recommendation? Currently I’m pulling data from a websocket and I’d like to add a point or multiple points to the existing array in an efficiently manner |
It depends on the amount of data and the interval. You can test the following solutions and find out which one will be best for you:
We try to keep this repository only for bugs, so in the future please contact Highcharts suport for this type of questions: https://www.highcharts.com/blog/support/ Best regards! |
I'm using Highstock and have something like this as dataset:
If I use If I use
After that I can see following output:
As you can see, |
Hi @LucidityDesign, That issue is probably not related with You can start from: http://jsfiddle.net/BlackLabel/z394cktd/ Best regards! |
Hi, It seems like Highcharts is modifying my data array. If I pass a clone of the array ( |
Yes, Highcharts mutate source data array for performance. You can check this thread: highcharts/highcharts#4259 for more information. |
The best way to add a new point is to call |
I'm having a problem on the rendering speed of this.
Data comes continuously at a frequency of 100Hz or higher and I need to show them on the chart. Now I'm using a button to trigger the update process of HighchartsReact, but with the growing size of data, the update process gets quite slow and blocks UI.
After reading the code I found the update process here:
highcharts-react/src/HighchartsReact.js
Lines 23 to 25 in 9f47be6
It seems to update all the data every time by giving the entire "options" object to chart. I guess the chart won't diff the options. Apparently, if you draw tons of data every time, the rendering could be really slow.
In the example of Highcharts, series.addPoint is used to append data. So is there any chance I can actually "append" a point to Highcharts.series instead of writing the huge chunk of data every time?
The text was updated successfully, but these errors were encountered: