配置项如下
var arr = [120,90,50,88,30];
var symbols1 = [
'path://m144.68566,106.80695l0,-4.44878c0,-0.39786 -0.32552,-0.72338 -0.72338,-0.72338s-0.72338,0.32552 -0.72338,0.72338l0,4.44878c-0.83189,0.28935 -1.44676,1.08507 -1.44676,2.06163c0,1.19358 0.97656,2.17014 2.17014,2.17014s2.17014,-0.97656 2.17014,-2.17014c0,-0.94039 -0.61487,-1.73611 -1.44676,-2.06163zm1.44676,-0.83189l0,-7.2338c0,-1.19358 -0.97656,-2.17014 -2.17014,-2.17014s-2.17014,0.97656 -2.17014,2.17014l0,7.2338c-0.86806,0.65104 -1.44676,1.69994 -1.44676,2.89352c0,1.98929 1.6276,3.6169 3.6169,3.6169c1.98929,0 3.6169,-1.6276 3.6169,-3.6169c0,-1.19358 -0.5787,-2.24248 -1.44676,-2.89352zm-2.17014,5.78704c-1.59144,0 -2.89352,-1.30208 -2.89352,-2.89352c0,-1.08507 0.5787,-1.98929 1.44676,-2.49566l0,-7.63165c0,-0.79572 0.65104,-1.44676 1.44676,-1.44676s1.44676,0.65104 1.44676,1.44676l0,7.63165c0.86806,0.50637 1.44676,1.44676 1.44676,2.49566c0,1.59144 -1.30208,2.89352 -2.89352,2.89352z',
];
var symbols = [
'path://m317.41884,281.36186l0,-235.01328c0,-19.17849 -15.24649,-34.80215 -33.96199,-34.80215s-33.96199,15.62367 -33.96199,34.80215l0,234.9694c-15.07518,11.14722 -24.24021,29.18466 -24.24021,48.36314c0,32.91503 26.1246,59.64203 58.20219,59.64203s58.24502,-26.68311 58.24502,-59.59814c0,-19.17849 -9.16503,-37.21592 -24.28303,-48.36314l0.00001,-0.00001zm-33.96199,88.1245c-21.41361,0 -38.80146,-17.818 -38.80146,-39.76135c0,-14.08763 7.45194,-27.25364 19.40073,-34.40717c2.99791,-1.75547 4.83948,-5.04697 4.83948,-8.60179l0,-17.90577l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-19.88068l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-20.05622l4.83948,0c2.69811,0 4.83948,-2.23822 4.83948,-4.9592c0,-2.76486 -2.18419,-4.9592 -4.83948,-4.9592l-4.83948,0l0,-3.73037c0,-8.20681 6.50974,-14.92148 14.56125,-14.92148c8.00869,0 14.56125,6.67078 14.56125,14.92148l0,240.36746c0,3.55482 1.84157,6.84633 4.83948,8.60179c11.99162,7.10965 19.40073,20.27566 19.40073,34.40717c0.04283,21.89946 -17.38785,39.71746 -38.80146,39.71746l0,0.00007z',
];
var bodyMax = 150;
var labelSetting = {
normal: {
show: true,
position: 'outside',
offset: [0, -0],
formatter: function(param) {
return(param.value / bodyMax * 100).toFixed(0) + '%';
},
textStyle: {
fontSize: 18,
fontFamily: 'Arial'
}
}
};
var markLineSetting = {
symbol: 'none',
lineStyle: {
normal: {
opacity: 0.3
}
},
data: [{
type: 'max',
label: {
normal: {
formatter: 'max: {c}'
}
}
}, {
type: 'min',
label: {
normal: {
formatter: 'min: {c}'
}
}
}]
};
var option = {
color: ["orange"],
tooltip: {
show:false,
},
/*legend: {
data: ['typeA', 'typeB'],
selectedMode: 'single'
},*/
xAxis: {
data: ['a'],
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false
}
},
yAxis: {
max: bodyMax,
offset: 20,
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false
}
},
grid: {
top: 'center',
height: 300,
width: 200,
},
markLine: {
z: -100
},
series: [{
name: 'typeA',
type: 'pictorialBar',
symbolClip: true,
symbolBoundingData: bodyMax,
label: labelSetting,
data: [{
value: 130,
symbol: symbols1[0]
}],
// markLine: markLineSetting,
z: 10
}, {
name: 'bg',
type: 'pictorialBar',
symbolBoundingData: bodyMax,
label:{
show:false,
},
animationDuration: 0,
itemStyle: {
normal: {
color: function(params){
var colors = ["lightblue","green","red"];
return colors[params.dataIndex];
}
}
},
data: [{
value: 1,
symbol: symbols1[0]
}]
}]
};