echarts设置双y轴

使用数组的方式添加yAxis

yAxis: [{
    name: 'xx1',
    type: 'value'
}, {
    name: 'xx2',
    type: 'value'
}]

然后,不要忘记在series中添加yAxisIndex属性

series: [{
    name: 'xx1',
    type: 'line',
    yAxisIndex: 0,
    data: data1
}, {
    name: 'xx2',
    type: 'line',
    yAxisIndex: 1,
    data: data2
}]
如果您觉得本文对您有用,欢迎捐赠或留言~
微信支付
支付宝

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注