highslide-software/highcharts.com — Issue #789: Numeric or Datetime data not in ascending x order breaks tooltip
Author: shiftyp
Created: 2012-02-27 16:30:40+00:00
State: open

I'm not sure if this is really a bug that you'll want to fix, but basically if the data that is input into the chart series is not in ascending order (by the data points x value), the tooltip shows up on the last point for the first point, and the first point for every other point in the chart. See [this jsfiddle](http://jsfiddle.net/TL7SW/) for datetime and [this jsfiddle](http://jsfiddle.net/ycdna/) for linear axes. The issue is that [this calculation](https://github.com/highslide-software/highcharts.com/blob/fc649c4743b760592c0303aa1817a8e664ba5bc6/js/parts/Series.js#L1201) assumes that the points are in ascending order, when in fact they may not be. The solution would be to sort the datapoints sometime before this calculation occurs.