简体   繁体   English

高图显示具有多个数据序列的相同yAxis起始值和终止值

[英]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. 我正在尝试使左右yAxis都显示相同的开始和结束。 Is it possible to show the same increment on yAxis with multiple data series? 是否可以在带有多个数据序列的yAxis上显示相同的增量? 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. 您可以通过对两个轴使用相同的min,max和tickInterval来控制轴标签。 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. Highcharts还具有使用linkedTo属性将多个轴链接在一起的功能。 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
                }
            ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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