Highchart yAxis在类型datetime中不起作用


Highchart yAxis opposite is not working in type datetime

我遵循了highcharts的文档,如果我们想要两端都有轴,我们必须这样做。

    yAxis: [
        {
            type: 'datetime',
            title: {
                text: 'primary'
            }
        },
        {
            opposite : true,
            type: 'datetime',
            title: {
                text: 'secondary'
            }
        },
    ],

但是在我的情况下,我得到了预期的主轴,但次级轴没有给出预期的结果。它显示文本"次要",但没有给出轴。

这种情况可能发生在没有指定轴或轴没有linkedTo属性设置为可见轴的情况下。

修复方法:

如果你只想显示一个系列的2个轴-为yAxis设置linkedTo。API参考:http://api.highcharts.com/highcharts#yAxis.linkedTo

示例:http://jsfiddle.net/up9Lebps/2/

如果你想为不同的级数显示2个轴-为级数设置yAxis。API参考:http://api.highcharts.com/highcharts#series.yAxis

示例:http://jsfiddle.net/up9Lebps/3/