简体   繁体   English

Highstock图表-Xaxis标签问题

[英]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. xAxis标签显示不正确。

在此处输入图片说明

its showing xAxis Label, Feb '08 as starting label, I want to start with Jan '08 from first label. 其显示xAxis标签, Feb '08Feb '08为开始标签,我想从第一个标签开始,从Jan '08开始。

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

To specify labels for exact timestamps, you can use tickPositions array. 要指定确切时间戳的标签,可以使用tickPositions数组。 You also need to use Highcharts.dateFormat function to format dates. 您还需要使用Highcharts.dateFormat函数来格式化日期。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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