Accepted answer

I see that date variable in your code is a string:

            // all data lines start with a double quote
            line = line.split(',');
            date = line[1] + " " + line[2];


                    parseInt(line[3], 10)

If you choose to construct the point's options as an array of two values and the first value is a string then it's treated as its name property (not x).


In that case Highcharts assigns subsequent integers as x values for all points (that's why there're values like 00:00:00.000 (1 Jan 1970), 00:00:00.001 etc.).

You need to parse your date to timestamp. You can use Date.UTC() ( or some other function for this.


I've managed to get it working with Date.UTC using the following code:

var yyyymmdd = line[2].split("-"); //Split the date: 2017 12 16
var hhmmss = line[3].split(":"); //Split the time: 16 11 14
var date = Date.UTC(yyyymmdd[0], yyyymmdd[1] - 1, yyyymmdd[2], hhmmss[0], hhmmss[1], hhmmss[2]); //Stitch 'em together using Date.UTC

Related Query

More Query from same tag