使用多个Y轴时,若设置某个Y轴起始坐标不为0,则柱状图显示时会出现BUG,翻文档及各种度娘无果,来此求教怎么解决,请指教
配置项如下
option = {
title: {
text: '多Y轴柱状图显示问题'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
xAxis: {
data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
},
yAxis: [{
type: 'value',
name: '频率',
min: 0,
max: 200,
position: 'left',
offset: 50,
maxInterval: 20,
axisLabel: {
formatter: '{value} 次/分'
}
},
{
type: 'value',
name: '温度',
min: 30,
max: 43,
position: 'left',
maxInterval: 1,
axisLabel: {
formatter: '{value} °C'
}
},
],
series: [{
stack: "体温显示修复",
type: "bar",
yAxisIndex: 1,
data: [30, 30, 30, 30, 30, 30],
itemStyle: {
normal: {
barBorderColor: 'rgba(0,0,0,0)',
color: 'rgba(0,0,0,0)'
},
emphasis: {
barBorderColor: 'rgba(0,0,0,0)',
color: 'rgba(0,0,0,0)'
}
},
}, {
name: '体温',
stack: "体温显示修复",
type: 'bar',
yAxisIndex: 1,
data: [4, 5, 10, 9, 7],
}, {
name: '脉搏',
type: 'bar',
data: [82, 90, 99, 100, 85]
}]
};