简体   繁体   中英

Highcharts show the same yAxis start and end value with multiple data series

I'm trying to get both the left and right yAxis to show the same start and end. Is it possible to show the same increment on yAxis with multiple data series? If so could you provide a sample code or point to an example. Here's what I'm trying to achieve.

在此处输入图片说明

Thank you in advance for your help!

Yes it is possible. You can control the axis labels by using the same min, max, and tickInterval for both axis. In the following example I use the following on both series:

min: 0,
max: 600,
tickInterval: 50,

Highcharts also has the functionality to link multiple axis together using the linkedTo attribute. All you have to specify in the properties of an axis is what axis it is linkedTo by specifying its index in the array of axes.

yAxis: [

                { // Primary
                    title: {
                        text: "Label for first Axis"
                    }
                },
                { // Dependent Axis
                    title:{
                        text: "Label for dependent Axis"
                    },
                    linkedTo: 0
                }
            ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM