Force Highcharts to show last x-axis label

2019-08-08 09:07发布

问题:

In the following Highcharts graph, I'd like the last label in the x-axis to be 2017 instead of hidden. That way it's crystal what the last year in the chart is.

I'm hoping there's a way to accomplish this while keeping the tick interval at 2. In other words, the first label would be 1999, and the last would be 2017.

回答1:

Use xAxis.endOnTick - Doc link

xAxis: {
    endOnTick: true,
    showLastLabel: true // Default is true but just in case
},

Fiddle



标签: highcharts