我正在创建一个带有日期X轴的图表,时间跨度为十年。刻度步长设置为“年”,并设置了最小值和最大值。图表呈现正常,但我希望刻度、指南和标签显示在时间跨度内每个年末日期上,而不是从最小日期开始,并以每年一刻度的方式“步进”。有没有一种方法可以配置此功能?
以下是示例图表定义。
以下是示例图表定义。
var chartData = { "type":"line",
"utc":true,
"timezone":0,
"scale-x":{ "min-value":1153180800000,
"max-value":1470441600000,
"step":"year",
"transform":{ "type":"date",
"all":"%m/%d/%y" },
"guide":{ "visible":true,
"line-color":"#666666",
"line-style":"solid",
"line-width":1,
"alpha":0.5 },
"item":{ "font-size":12 } },
"scale-y":{ "placement":"default",
"format":"%v",
"values":"1.00:14.00:2.6",
"item":{ "font-size":12 } },
"series":[ { "type":"line",
"scales":"scale-x,scale-y",
"marker":{ "type":"none" },
"values":[ [1159574400000,10.67],[1167523200000,11.06],[1175299200000,11],[1183161600000,11.2],[1191110400000,10.86],[1199059200000,11.2],[1206921600000,12.01],[1214784000000,12.93],[1222732800000,9.38],[1230681600000,6.27],[1238457600000,3.68],[1246320000000,2.8],[1254268800000,7.15],[1262217600000,9.35],[1269993600000,11.45],[1277856000000,11.51],[1285804800000,10.7],[1293753600000,11.05],[1301529600000,10.87],[1309392000000,10.09],[1317340800000,8.73],[1325289600000,7.4],[1333152000000,7.27],[1341014400000,6.83],[1348963200000,8.01],[1356912000000,6.71],[1364688000000,6.45],[1372550400000,7.01],[1380499200000,6.87],[1388448000000,8.59],[1396224000000,8.46],[1404086400000,8.8],[1412035200000,8.27],[1419984000000,7.73],[1427760000000,7.62],[1435622400000,7.03],[1443571200000,6.74],[1451520000000,4.81] ] } ] };