Kyle Decot
Kyle Decot

Reputation: 20835

Highcharts Datetime Issue

I'm attempting to design a chart for displaying datetime based data:

https://jsfiddle.net/kyledecot/LLExL/5539/

This works however Highcharts doesn't seem to like the format of my x axis data. What format should I be using for this?

$('#container').highcharts({
    xAxis: {
       type: 'datetime'
    },    
    series: data
});

Upvotes: 0

Views: 84

Answers (1)

wergeld
wergeld

Reputation: 14462

Your date value are strings here and are not in expected javascript time. See docs here. You should either convert your timestamps to javascript time (integer) or use something like this in your data series:

data: [
[Date.UTC(year,month,day,hours,minutes,seconds,millisec), yValue]
]

Upvotes: 4

Related Questions