I have some problem with Highcharts chart. I want to make chart with datetime axis every one day, but Highcharts cuts off first date label on the x axis, it should start from today's date not tomarrow. Tooltip shows date fine though. Are there some Highcharts settings, that I missing to make it work? I would appreciate your help. Thanks.
Code:
var s = {
min: 0,
max: 50,
totalPoints: 12
};
function getRandomData() {
var data = [],
date = new Date().getTime(),
res = [],
numb;
for (var i = 0; i < s.totalPoints; i += 1) {
if (i > 0) date += 24 * 3600 * 1000;
numb = Math.floor(Math.random() * (s.max - s.min + 1) + s.min);
res.push([date, numb]);
}
return res;
}
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
},
xAxis: {
type: 'datetime',
tickInterval: 24 * 3600 * 1000
},
series: [{
data: getRandomData()
}]
});
});
Live on: jsfiddle