Jakub Werner
Jakub Werner

Reputation: 23

Highcharts update series type dataloss

I'm trying to update series types in Highchart but there is a data loss in it.

Here is my snippet:

h = Highcharts.charts[0]
h.series[0].options.type
-> "candlestick"
h.series[0].options.data[0]
-> [1386543600000, 111.69, 111.79, 109, 109.39]

h.series[0].update({type: "spline"})
h.series[0].options.data[0]
-> Object {x: 1386543600000, y: 111.69}

jsfiddle, which show the dataloss with Highstock/StockChart: http://jsfiddle.net/fqd1bshm/1/

Update 1

If I use the navigator with Highcharts: http://jsfiddle.net/9mby1xqn/1/ the same problem occurs.

Thanks

Upvotes: 0

Views: 353

Answers (1)

Jakub Werner
Jakub Werner

Reputation: 23

Found a solution. It was the navigator that "updates" the data. If you want it to stop doing that, you have to set the adaptToUpdatedData value in the Highcharts configuration.

Should then look like this:

navigator: {
  enabled: true,
  adaptToUpdatedData: false
}

jsfiddle: http://jsfiddle.net/9mby1xqn/3/

Upvotes: 1

Related Questions