All right, I was doing it the other way around, and that's why I was not able to reproduce the described error. Well, so now I see the problem, but as I thought, it's caused by passing not sorted (x ascending order) data, what you can notice after opening the browsers console, and see the Highcharts #15 error.

In order to make it work correctly, you need to always make sure that you're passing the data, which is sorted in ascending order (point x values are increasing along with the array element index).

So, to sum up, sort the array:


  // data here

].sort((a, b) => a.x - b.x)

then change the the way you prepare (slice) the initial data:

data.slice(data.length - 1 - 15, data.length - 1)

and now it should work as expected.

Live examples:

Related Query

More Query from same tag