简体   繁体   中英

Highstock chart - issue with xaxis label

I have some data with last date of each month.

for eg

[1504137600000, 52.2]
[1501459200000, 52.1]
[1498780800000, 52.4]
[1496188800000, 53.1]
[1493510400000, 52.7]
[1490918400000, 52.4]
[1488240000000, 53.3]

When i plot the chart using this data. xAxis label not showing properly.

在此处输入图片说明

its showing xAxis Label, Feb '08 as starting label, I want to start with Jan '08 from first label.

jsfiddle: http://jsfiddle.net/xtgj4y0d/1/

To specify labels for exact timestamps, you can use tickPositions array. You also need to use Highcharts.dateFormat function to format dates.

API Reference:
http://api.highcharts.com/highcharts/xAxis.tickPositions
http://api.highcharts.com/highcharts/Highcharts.dateFormat

Example:
http://jsfiddle.net/wL7o3zd3/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM