1

大家好, 在我想要的第一天,图表没有显示第一个刻度。

下面是我的代码:

//1周

series : [ {data : yValue, pointStart : Date.UTC(2010, 0, 1),pointInterval : 7 * 24 * 3600 * 1000} ]

4

1 回答 1

0

try showFirstLabel: true option and startOnTick: true option

The document is here:http://api.highcharts.com/highcharts#xAxis.showFirstLabel

This is an option can be used on both xAxis and yAxis


Updated:

Based on your description. I think the "startOfWeek" is taking effect. It automatically make the first tick of xAxis as Mondy then to your added dates. I don't know if there's a way to turn it off. You have two ways to make it display correctly:

  1. provide your date and yValue together as key-values and pass it to chart all together instead of generating xAxis from option or

  2. calculate the first day of your utcDate and set startOfWeek to the corresponding value (default is Monday => 1, and respectively 2 to 6, then 0 for Sunday)

于 2013-05-24T09:10:34.167 回答