How can I force multiple y-axis in Highcharts to have a common zero

后端 未结 7 1432
萌比男神i
萌比男神i 2021-01-02 00:32

See this JSFiddle. How do I get the y-axis zero to align?

7条回答
  •  清歌不尽
    2021-01-02 00:57

    You can set min / max value for first yAxis and use linkedTo to second axis, but I'm not sure if you expect this effect:

    http://jsfiddle.net/qkDXv/2/

    yAxis: [{ // Primary yAxis
                labels: {
                    format: '{value}°C',
                    style: {
                        color: '#89A54E'
                    }
                },
                title: {
                    text: 'Temperature',
                    style: {
                        color: '#89A54E'
                    }
                },
                min:-250,
                max:50
                //linkedTo:1
            }, { // Secondary yAxis
                title: {
                    text: 'Rainfall',
                    style: {
                        color: '#4572A7'
                    }
                },
                labels: {
                    format: '{value} mm',
                    style: {
                        color: '#4572A7'
                    }
                },
                opposite: true,
                linkedTo:0
            }],
    

提交回复
热议问题