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BORw0KGgoAAAANSUhEUgAAACgAAAAKCAIAAABJ+IsHAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABo0lEQVR42oVT243CMBBMD0ec2g64ZuI4LoMkPwchJRzQGrMzthNOSEiWtd7XzD5cNWNwoz/e538Hyq+xc0NH61L0+8eZ1tCMHibc+4f0cxGKCW4KOdwuEHTTFCoCh3fAoTZUA1DA993un9ucgS0wx55zYKJVHKRHlJIc/y6OhD4A10PbTC3BziqoWJtN6pR0renFWugebr8QkPAD8G6KvF9arWayJg9mzdSVNhYBSnbLKtMIBEzrFQndGKsN66ucIKztOnUEnjfErZkGyUG6oX1T8dBqxnDTjAswDhIibVWWS7xw1FImTTNGxdJnn2U3mR7bB2H/WMgVXVnI3qwwwQECnLe84eBsfL2Ao+qGH07eiwgZlKnx7E/QkkOuh97GT41Kx7POhVIZqOnhbCxPpmESz7QJWH8jWIssOD0T6sCBsfrEaWht/NRAIJ42saPQajmchUcl1KlzKqStyq+wX0vuFIJ4cJZBs1TeTA5N8iyrR9/qTIvr1psysY8udSL9EZeiOOMcFjO1uPnEMdFfj9fwSFEZ262DnjR5rULuU7d2cYxP9g05A9CyfQUAAAAASUVORK5CYII='
var PatternImgA = new Image();
var PatternImgB = new Image();
var PatternImgC = new Image();
var PatternImgD = new Image();
var PatternImgE = new Image();
var PatternImgF = new Image();
PatternImgA.src = PatternSrcA;
PatternImgB.src = PatternSrcB;
PatternImgC.src = PatternSrcC;
PatternImgD.src = PatternSrcD;
PatternImgE.src = PatternSrcE;
PatternImgF.src = PatternSrcF;
var itemStyleA = { normal: {color: {image: PatternImgA,repeat: 'repeat'}}};
var itemStyleB = { normal: {color: {image: PatternImgB,repeat: 'repeat'}}};
var itemStyleC = { normal: {color: {image: PatternImgC,repeat: 'repeat'}}};
var itemStyleD = { normal: {color: {image: PatternImgD,repeat: 'repeat'}}};
var itemStyleE = { normal: {color: {image: PatternImgE,repeat: 'repeat'}}};
var itemStyleF = { normal: {color: {image: PatternImgF,repeat: 'repeat'}}};
option = {
color:['#c03a2a', '#16a185', '#2c3f50',, '#666'],
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
x: 'right',
data:['20', '50', '80', '100', '150', '300', '500', '800', '1000']
},
yAxis : [
{
type : 'value'
}
],
xAxis : [
{
type : 'category',
data : ['产品1','产品2','产品3','产品4','产品5','产品6','产品7','产品8' ]
}
],
series : [
{
name:'20',
type:'bar',
stack: '总量',
barWidth: '40px',
data:[0, 212, 101, 0, 0, 0, 120, 0]
},
{
name:'50',
type:'bar',
stack: '总量',
data:[0, 232, 251, 0, 0, 0, 10, 0]
},
{
name:'80',
type:'bar',
stack: '总量',
data:[0, 232, 231, 134, 190, 0, 110, 0]
},
{
name:'100',
type:'bar',
stack: '总量',
data:[0, 132, 101, 0, 0, 150, 210, 0],
itemStyle: itemStyleA
},
{
name:'150',
type:'bar',
stack: '总量',
data:[120, 252, 201, 134, 60, 0, 150, 0],
itemStyle: itemStyleB
},
{
name:'300',
type:'bar',
stack: '总量',
data:[120, 0, 0, 184, 70, 0, 0, 90],
itemStyle: itemStyleC
},
{
name:'500',
type:'bar',
stack: '总量',
data:[120, 0, 0, 174, 10, 230, 0, 0],
itemStyle: itemStyleD
},
{
name:'800',
type:'bar',
stack: '总量',
data:[220, 0, 0, 134, 70, 0, 0, 0],
itemStyle: itemStyleE
},
{
name:'1000',
type:'bar',
stack: '总量',
data:[0, 0, 0, 0, 0, 0, 0, 90],
itemStyle: itemStyleF
}
]
};