已经画出两条线来,但是怎么才能设置中间区域为阴影
配置项如下
option = {
title: {
text: '需求趋势图'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
animation: false,
label: {
backgroundColor: 'yellow',
borderColor: 'red',
borderWidth: 1,
shadowBlur: 0,
shadowOffsetX: 0,
shadowOffsetY: 0,
textStyle: {
color: 'red'
}
}
}
},
legend: {
data: ['观测值', '拟合值', '预测值', '置信区间']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap: false,
data: date_time
}],
yAxis: [{
type: 'value'
}],
series: [{
name: '观测值',
type: 'line',
data: [-2499.0, -5504.0, -5057.4, -936.0, -8016.0, -12733.0, -1428.0, -2260.0, -19664.0, -11686.0],
hoverAnimation: false,
symbolSize: 6,
itemStyle: {
normal: {
color: '#c23531'
}
},
showSymbol: false
}, {
name: '拟合值',
type: 'line',
data: [-3519, -6245, -6078, -1956, -9036, -13753, -2448, -3280, -20684],
hoverAnimation: false,
symbolSize: 6,
itemStyle: {
normal: {
color: 'blue'
}
},
showSymbol: false
}, {
name: '预测值',
type: 'line',
data: [-12706.77777778 - 13727.55555556 - 14748.33333333 - 15769.11111111 - 16789.88888889],
hoverAnimation: false,
symbolSize: 6,
itemStyle: {
normal: {
color: 'yellow'
}
},
showSymbol: false
}, {
name: '最大趋势',
type: 'line',
data: [null, null, null, null, null, null, null, null, null, null, -11686, 3084.91863283, 8605.27568121, 12603.6871875, 15814.2817101, 18521.4177653],
lineStyle: {
normal: {
opacity: 0
}
},
areaStyle: {
normal: {
color: '#ccc'
}
},
stack: 'confidence-band',
symbol: 'none'
}, {
name: '最小趋势',
type: 'line',
data: [null, null, null, null, null, null, null, null, null, null, -11686, -28498.4741884, -36060.3867923, -42100.3538542, -47352.5039323, -52101.1955431],
lineStyle: {
normal: {
opacity: 0
}
},
areaStyle: {
normal: {
color: '#ccc'
}
},
stack: 'confidence-band',
symbol: 'none'
}]
};