You have passed the incorrect time in the x , current x value is 1550862788
if you passed this into to new Date(1550862788) you will get Mon Jan 19 1970 04:17:42 GMT+0530 (India Standard Time)
If you want 23/02/2019, 00:43:08
to be the starting x-axis value you need to pass 1550862788000
for now I have increment 1hr for each x-axis value.
Highcharts.setOptions({
time: {
useUTC: false
}
});
$(function() {
$('#container').highcharts({
series: [{
"name": "avg_sales",
"color": "#3b6982",
"data": [{
"x": 1550862788000,
"y": 526.4200000000001
}, {
"x": 1550866388000,
"y": 1850.3116666666667
}, {
"x": 1550869988000,
"y": 3199.786
}]
}],
tooltip: {
dateTimeLabelFormats: {
hour: '%A, %b %e, %l %p'
},
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
millisecond: '%e. %b %I:%M %P',
second: '%e. %b %I:%M %P',
minute: '%e. %b %I:%M %P',
hour: '%e. %b %I:%M %P',
day: '%e. %b %I:%M %P',
week: '%e. %b %I:%M %P',
month: '%e. %b %I:%M %P',
year: '%e. %b %I:%M %P'
},
},
});
});
Updated Jsfiddle : https://jsfiddle.net/karnan796/veykdm7h/6/
To get the milliseconds for the current or specific date please make use of it currentmillis