I was able to get everything to work in my charts. Here is a summary of my findings:
The setData() method does work. The problem that I was having was that I did not tell the chart how many data points to display on initial render (with the range selector buttons), so the chart was rendering as a blank chart. The navigator was being populated with data, but the chart remained blank.
I used some of the ideas from this post to programmatically set the min and max values that should be rendered in the chart when it first loads up:
https://stackoverflow.com/questions/241 ... -highstock.
(I would post the actual code I used, but it would just be confusing because my actual code pulls data from a database and it is not too similar to the code that was posted in the codesandbox links. The above StackOverflow link should be helpful, though.)
I then had to programmatically select the initial range selector button. For some reason, the rangeSelector.selected option in the Highcharts configs didn't work in my instance, so I had to programmatically select the button I wanted when the charts were initially rendered.
Here is the code for that:
Code: Select all
const chart = this.$children[0].chart;
chart.rangeSelector.buttons[0].element.onclick();
At this point, the chart was working fine along with the animations. The initial data was populating the charts and the live data was streaming in.
The final issue I had was that the data that was streaming in seemed a little out of sync with what was being displayed in the chart. I had to make a few adjustments to the database query that I was running, but that has nothing to do with Highcharts-Vue.
I hope that helps!