superman66 / vue-highcharts

The Component of Vue 2.x for highcharts
https://codesandbox.io/s/jjyqvv0k13
MIT License
115 stars 48 forks source link

Dynamic Charts #35

Closed justmark closed 6 years ago

justmark commented 6 years ago

Hi,

I'm trying to create dynamic chart. I've set up a periodic timer outside the option-configuration for the chart (so that I can destroy it later.)

The timer function is using axios to poll for data, and all that is working fine. I'm trying to call addPoint though, and am getting an error:

TypeError: p.splice is not a function

The code I'm using for addPoint is:

let highCharts = this.$refs.liveChart
highCharts.getChart().series[0].addPoint([result.data.b_v.x, result.data.b_v.y], true, true)

result.data.b_v.x. and .y do have the correct x and y values.

I also was looking to use your delegateMethod for this, but couldn't figure out how to set that up.

Any suggestions?

superman66 commented 6 years ago

you can put your code in online editor such as codebox.io.

justmark commented 6 years ago

Got this working. The issue was that the original series had some bad data preventing addPoint from succeeding.