首页 文章

在y轴上的Highcharts自定义缩放 - 线性和对数的混合

提问于
浏览
1

我试图在我的图表上使用对数刻度,如下所示:

但是,出站数据远低于入站数据 . 这在图表中没有正确显示,并且看起来实际上有更多的出站数据而不是入站数据 .

我希望线性刻度达到y轴的最大值(136)和一些额外的最大值,所以基本上高达150它应该显示线性刻度,并从那里高达600(显示最大容量标记)是对数的 . Highcharts是否可以实现这一点?也许最好的功能是tickPositioner http://api.highcharts.com/highcharts#yAxis.tickPositioner .

最终的期望结果应该是这样的:

1 回答

  • 2

    嗯,这肯定是一个混乱的解决方案,但你可以将两个图组合在一起:

    enter image description here

    小提琴here .

    $(function () {
            $('#containerBot').highcharts({
                chart: {marginTop: 1},
                title: {margin: 0, text: ''},
                yAxis: {max: 100},
                exporting: {enabled: false},
                series: [{
                    name: 'One',
                    data: [70.0, 60.9, 90.5, 140.5, 180.2, 210.5, 205.2, 260.5, 230.3, 180.3, 130.9, 90.6]
                }, {
                    name: 'Two',
                    data: [-0.2, 0.8, 50.7, 110.3, 170.0, 220.0, 240.8, 204.1, 200.1, 140.1, 80.6, 20.5]
                }]
            });
            $('#containerTop').highcharts({
                chart: {marginBottom: -1},
                title: {text: 'My Chart'},
                yAxis: {min: 100},
                xAxis: {labels: {enabled: false}},
                legend: {enabled: false},
                exporting: {enabled: false},
                credits: {enabled: false},
                series: [{
                    name: 'One',
                    data: [70.0, 60.9, 90.5, 140.5, 180.2, 210.5, 205.2, 260.5, 230.3, 180.3, 130.9, 90.6]
                }, {
                    name: 'Two',
                    data: [-0.2, 0.8, 50.7, 110.3, 170.0, 220.0, 240.8, 204.1, 200.1, 140.1, 80.6, 20.5]
                }]
            });
    });
    

相关问题