Highcharts screen - using setData chart does not stay collapsed

I have a high graph chart with a scan module that works great. At some point, I would like to update the chart with a new dataset. I use

chart.options.drilldown.series = drilldownSeries;

//This forces the chart to go back to level one     
chart.series[0].setData(brandsData);

And it gives a nice animation with updated data. However, when I was β€œdrilled” and I use setData, the chart returns to the first level, as if I had not been drilled.

See: http://jsfiddle.net/n0y4vu24/1/

First: click update data - you will see that the first bar goes to 20, which is great. Run jsfiddle again, but before you click update data, click on the first line. Now, when you click the update data, it will return to the β€œbrands” diagram, which will not remain and will update the detail diagram

Is there a way to stay at the current graph level / current level of detail?

+4
source share
1 answer

This is because you are updating the first serial number (index 0), not the serial number. Therefore, the behavior is correct, but in your case you need to destroy the chart and prepare a new one with new data, because setData is not available at drilled points.

0

All Articles