Highcharts: 2nd x axis, first and last labels cut off

ε祈祈猫儿з 提交于 2019-12-13 01:53:59

问题


I have a chart with 2 linked x axes, mostly duplicated - one on top, one on bottom.

They use categories, and in order to trim extra space off of the left and right of the chart, I have set the min to 0.25, and max to [# of categories].75.

The first x axis responds as desired, and shows all categories correctly.

The 2nd x axis does not show the first or the last category.

If I remove the min/max settings, both axes show correctly, but with more space than I want.

But since the first axis does show all categories, it must be possible for both axes to show all categories.

Axis code:

xAxis  : [{
    min:0.25,
    max:5.75,
    opposite: true,
    categories: catsTop,
    tickmarkPlacement: 'on',
},{
    linkedTo:0,
    categories: catsBot,
    tickmarkPlacement: 'on'
}]

tickmarkPlacement: 'on' is required for this chart.

Fiddle:

  • https://jsfiddle.net/jlbriggs/mvgymfw6/7/

I have tried changing the chart alignTicks property, showFirstLabel/showLastLabel, startOnTick/endOnTick, have placed first axis on top/2nd axis on bottom, first axis on bottom/second axis on top, etc, but can't get the 2nd axis to properly show the labels.

Any tips appreciated.

来源:https://stackoverflow.com/questions/31186557/highcharts-2nd-x-axis-first-and-last-labels-cut-off

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!