javascript HighCharts - 显示 xAxis 中的最后一个标签
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5400573/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HighCharts - show last labels in xAxis
提问by Norbert Tamas
How can I force to show last labels in xAxis? I tried to use showLastLabel: true. But as you see doesn't really work.
如何强制在 xAxis 中显示最后一个标签?我尝试使用 showLastLabel: true。但正如你所见,这并不奏效。
See example: http://fiddle.jshell.net/X3jPh/770/
回答by NT3RP
In addition to the showLastLabel
property, you may need to add the endOnTick
flag to your example. For example:
除了showLastLabel
属性之外,您可能还需要将endOnTick
标志添加到您的示例中。例如:
//...
xAxis: [{
type: 'datetime',
showLastLabel: true,
endOnTick: true
},
//...
回答by mikeopoku
Use tickPositions Array:(number) to specifically identify which indices you want displayed on your xAxis.
使用 tickPositions Array:(number) 来具体确定您想要在 xAxis 上显示的索引。