markArea的值域大于x轴的值域,是否能让markArea的值域显示出来
配置项如下
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['深水区', '浅水区']
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01],
splitLine: {
show: false
},
},
yAxis: {
type: 'category',
data: ['06-01', '06-02', '06-03', '06-04'],
axisTick: {
alignWithLabel: true
}
},
color: ['rgb(55, 133, 199)', 'rgb(157, 206, 249)'],
series: [{
name: '深水区',
type: 'bar',
data: [1.5, 0.5, 2, 2.5],
itemStyle: {
normal: {
label: {
show: true,
position: 'right',
formatter: function(params) {
if (params.value > 0) {
return params.value;
} else {
return '';
}
}
}
}
},
z: 0
}, {
name: '浅水区',
type: 'bar',
data: [1.5, 0, 2, 2.5],
itemStyle: {
normal: {
label: {
show: true,
position: 'right',
formatter: function(params) {
if (params.value > 0) {
return params.value;
} else {
return '';
}
}
}
}
},
z: 0,
markArea: {
silent: true,
z: 1,
itemStyle: {
normal: {
color: 'rgb(254, 202, 197)',
opacity: 0.7
}
},
label: {
normal: {
show: true,
color: 'rgb(255, 100, 88)',
}
},
data: [
[{
name: '标准值:7.0~7.8',
xAxis: '7.0',
}, {
xAxis: '7.8'
}]
]
}
}]
};