So I have en array with some data. I use the setData
method to set the data on my series like so:
chartInstance.series[0].setData(chartData);
This works fine the first time, but let's say I change some of the data in chartData
and want to apply it to my highchart. The next time I call the setData()
method like above, it doesn't work for me, as in I don't see that changes applied to my chart. However, it works if I do it like this, with slice()
:
chartInstance.series[0].setData(chartData.slice());
I was just wondering if this is expected behavior and if so why it works like that? Thanks.