想通过barGap:'-100%' 将最后一个元素作为系列的阴影,但是却发现这个属性是全局属性,只有最后一个生效
配置项如下
option = {
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'line' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{
type : 'category',
data : ['产品1', '产品2', '产品3', '产品4', '产品5', '产品6', '产品7'],
axisTick: {
alignWithLabel: true
}
},
{
show: false,
type : 'category',
data : ['产品1', '产品2', '产品3', '产品4', '产品5', '产品6', '产品7'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'0',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '0',
data:[10, 10, 10, 10, 10, 10, 10]
},{
name:'1',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '1',
data:[52, 52, 100, 134, 320, 150, 220]
},{
name:'2',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '2',
data:[200, 122, 120, 234, 310, 330, 130]
},{
name:'3',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '3',
data:[310, 52, 210, 314, 390, 120, 90]
},{
name:'4',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '4',
data:[239, 32, 100, 354, 290, 230, 220]
},{
name:'5',
type:'bar',
barGap:'0',
barWidth: '10px',
stack: '5',
data:[139, 52, 200, 334, 190, 130, 120]
},{ // For shadow
name: '总量',
type: 'bar',
itemStyle: {
normal: {color: 'rgba(0,0,0,0.05)'}
},
barWidth: '60px',
//
xAxisIndex: 1,
stack: '6',
zlevel: -1,
data: [420,410,430,440,410,460,410]
}
]
};