score:1

Accepted answer

If you added the the "type" to the xAxis definition then the x values will be interpreted as dates and times rather than decimal values

xAxis: {
    type : "datetime", //add this line
    gridLineWidth: 1,
    labels: {
        rotation: -45,
        align: 'right',
        style: {
            fontSize: '13px',
            fontFamily: 'Verdana, sans-serif'
        }
    }
},

you may have to fiddle with the start times and intervals to get HighChart to correctly interpret your x-values. see this demo on the highchart website as an example. http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/line-time-series/

score:1

The reason is that you are not actually creating a Stock chart. Your code looks like:

var chart = new Highcharts.Chart(options);

If you want it to be a Stock chart do:

var chart = new Highcharts.StockChart(options);

A Chart by default is a category chart. StockChart is time-based.

score:0

You can use dateFormat to replace time in miliseconds with date.

http://jsfiddle.net/3bE4X/

 formatter:function(){
                return Highcharts.dateFormat('%d / %m / %Y',this.value);
 }

http://api.highcharts.com/highcharts#Highcharts.dateFormat()


Related Articles