简体   繁体   English

Highcharts在刻度线上设置X轴标签

[英]Highcharts set X axis label on tick

I have a stockchart graph with a lot of data like [datetime,value]. 我有一个包含大量数据的股票图表,如[datetime,value]。 But my labels date are placed randomly i think. 但我认为我的标签日期是随机放置的。 When i zoom i would like to see my tick and the date of this tick. 当我缩放我想看到我的刻度和此刻度的日期。

But here i have for example ticks for the 10 jan , 15 jan , 20 jan and labels will be 9jan, 14jan, 19jan 但在这里我有例如10月,15日,20日和标签将是9jan,14jan,19jan

normally it's a weekly point but sometimes one can have one more or one less so i think tickInterval is not the good way for my case. 通常它是一个周点,但有时一个可以有一个或更少,所以我认为tickInterval不是我的情况的好方法。

Thanks for your help. 谢谢你的帮助。

img Example img例子

If tickInterval does not work for your scenario (because your data is at non-regular intervals) then you could use tickPositions. 如果tickInterval对您的场景不起作用(因为您的数据是非常规的间隔),那么您可以使用tickPositions。 You could extract the x values from your data, place the x values into an array, assign the array to tickPositions. 您可以从数据中提取x值,将x值放入数组中,将数组分配给tickPositions。

Documentation for tickPositions is at... tickPositions的文档是......

http://api.highcharts.com/highcharts#xAxis.tickPositions http://api.highcharts.com/highcharts#xAxis.tickPositions

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

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