Reputation: 459
I Use datetime
type in xAxis of Highchart and some of columns doesn't appear exactly in chart. For example in the below example you can see only a little part of first and last column. I don't know why.
What's the best solution for this problem?
Upvotes: 0
Views: 53
Reputation: 45079
It's caused by wrong order of points. You have an error in the console:
Highcharts error #15: www.highcharts.com/errors/15
In Highcharts, data should be sorted ascending by x-values, for example: http://jsfiddle.net/sc5hwtfz/2/
{
name: 'C1',
data: [
[Date.parse("04/26/2017" + " UTC"), 40],
[Date.parse("04/25/2017" + " UTC"), 143],
[Date.parse("04/24/2017" + " UTC"), 40],
[Date.parse("04/23/2017" + " UTC"), 30],
[Date.parse("04/22/2017" + " UTC"), 20],
[Date.parse("04/21/2017" + " UTC"), 20],
].sort(function (a, b) { return a[0] - b[0]; })
},
Upvotes: 1