I have a highcharts-chart
with four lines (series
).
I would like to update each series with one point (value
) and shift these four lines dynamically (1 in - 1 out) at the same time.
This works with one series in the chart perfectly:
chart.series[0].addPoint([x, 5], true, true);
Is there a fast way to add the point to all four lines at once?
Hanspeter
Yes, you can.
Exactly Highstock is much better for big data sets than Highcharts. It's because it was designed for this purpose. It has built-in data grouping facility, data is blazingly fast grouped into optional groups, which fastens the process a lot. Feel free to ask any further questions!
Highcharts - Updating a chart's option after initial render.
You could probably just iterate through the series and check the . name against your "passed in name" instead of scanning the document for "series_name". There really should be a chart. remove(series) (not just index, because the indices remap after you remove one).
You can can update each series on one line, but only make the last one redraw the chart like so:
chart.series[0].addPoint([x, 5], false, true);
chart.series[1].addPoint([x, 5], false, true);
chart.series[2].addPoint([x, 5], false, true);
chart.series[3].addPoint([x, 5], true, true);
Here is a JSFiddle illustrating the concept: http://jsfiddle.net/mkremer90/yZSzZ/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With