change highcharts detetime label -


i have looked @ highcharts api , came across datetimelabel haven't been able set label properly. here code, options

var options = {                     chart: {                         renderto: 'graph',                         defaultseriestype: 'line'                     },                     title: {                         text: 'kwh per phase'                     },                     xaxis: {                         title: {                             text: 'time period'                         },                         categories:[],                         type: 'datetime',                         datetimelabelformats: {                             day: '%e %b'                         }                      },                     yaxis: {                         title: {                             text: 'kwh per phase'                         }                     },                     series: []                 }; 

and part push in data

if (itemno === 0) { /* first item containes year */                                 options.xaxis.categories.push(item);                             }  

the datetime displayed how in csv file "1/2/2014 7:59"

if have pushed categories doesn't become datetime axis. normal axis categorised labels.

for datetime axis need specify type: 'datetime'

and pass date along data.

the date should either unix time stamp or utc date format.

examples:

with utc date http://jsfiddle.net/kolliparavamsikrishna/9xwpc/ http://jsfiddle.net/kolliparavamsikrishna/jfj5w/

timestamp http://jsfiddle.net/kolliparavamsikrishna/jfj5w/1/

you can format labels formatter.

i hope you.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -