Highcharts Multi-Panes and Scrollbar

陌路散爱 提交于 2019-12-13 03:39:29

问题


How to add a scroll with multi-panes?

Please look at the fiddle, 3rd pane is overlapping

yAxis: [{
    title: { text: 'Coffee Cups'},
    height: '60%',
    offset: 0,
    lineWidth: 2
  }, {
    title: { text: 'Hazelnut Cups' },
    top: '65%',
    height: '60%',
    offset: 0,
    lineWidth: 2
  }, {
    title: { text: 'Choco Cups' },
    top: '130%',
    height: '60%',
    offset: 0,
    lineWidth: 2
  }]

Note: In my scenario, it can be 100 multi panes.


回答1:


The sum of the heights of your y-axes is more than 100% which causes the overlapping. You should not exceed 100%:

        yAxis: [{
            labels: {
                align: 'right',
                x: -3
            },
            title: {
                text: 'Coffee Cups'
            },
            height: '33.33%',
            offset: 0,
            lineWidth: 2
        }, {
            labels: {
                align: 'right',
                x: -3
            },
            title: {
                text: 'Hazelnut Cups'
            },
            top: '33.33%',
            height: '33.33%',
            offset: 0,
            lineWidth: 2
        }, {
            title: {
                text: 'Hazelnut Cups'
            },
            top: '66.66%',
            height: '33.33%',
            offset: 0,
            lineWidth: 2
        }]

Live demo: http://jsfiddle.net/BlackLabel/g7uto6xc/

API Reference: https://api.highcharts.com/highstock/yAxis.height

EDIT:

After a lot of customizations, the wanted result was achieved:

Live demo: http://jsfiddle.net/BlackLabel/u293pvnj/



来源:https://stackoverflow.com/questions/54467415/highcharts-multi-panes-and-scrollbar

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