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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 17:04:26  来源:igfitidea点击:

HighCharts - show last labels in xAxis

javascripthighcharts

提问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/

参见示例:http: //fiddle.jshell.net/X3jPh/770/

回答by NT3RP

In addition to the showLastLabelproperty, you may need to add the endOnTickflag 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 上显示的索引。