jamesflagg
Posts: 2
Joined: Mon Oct 31, 2011 3:28 pm

Adding point in middle of series breaks tooltips, navigator?

Hi, latest issue I've run into is that if I dynamically add a point which occurs in the middle of a series, rather than at the end, the data renders OK, but the tooltips do not seem to function correctly.

Please see this simple JSFiddle.

http://jsfiddle.net/jamesflagg/NDEyy/

The chart starts out with just two data points. Mousing over the data produces the expected tooltips.

Now click the link below the chart to add an additional data point which occurs between the first two. Then, mouse over and observe the tooltips. Mousing over the first, leftmost data point still produces the expected tooltip; however, the tooltips for the other two points seem to be reversed. Also note that the navigator pane below the chart is displayed incorrectly.

So is adding points to the middle of a data series supported via addPoint(), or is there some other approach I would need to take?

Thanks!
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: Adding point in middle of series breaks tooltips, naviga

Highstock expects data to be ordered, so if you need to add a point in the middle you must add it to the raw data array, sort it then run setData.
Torstein Hønsi
CTO, Founder
Highsoft

Return to “Highcharts Stock”