我们的图表一旦引入了两种不同单位或者数量级相差很大的数据以后,这时候需要两种坐标对其进行计量。
下面以设置双Y轴为例,
y轴坐标的参数设置成:
yAxis: [{
title: {
text: '坐标一',
},
labels: {
overflow: 'justify'
},
gridLineWidth : 0,
stackLabels : {
style : {
color : '#fff'
}
}
},{
title: {
text: '坐标2',
},
labels: {
overflow: 'justify'
},
gridLineWidth : 0,
stackLabels : {
style : {
color : '#fff'
}
},
opposite : true
}],
然后在设置series时:
series: [{
name: '订单数',
data: uvList
},{
name: '销售额',
data: pvList,
yAxis : 1 // 注意要在这里显示设置一下
}],
完毕!