需求效果如下:
代码如下:
import maxNum from "../../../../../../public/img/top_jiantou.png"
series: [
{
name: "入库" + this.codeName,
type: "bar",
barWidth: 15,
data: inList,
itemStyle: {
barBorderRadius: [10, 10, 0, 0],
},
label: {
normal: {
show: true,
position: 'right',
distance: 10,
rich: {
img1: {
align: 'center',
height:87,
width:18,
backgroundColor: {
image: maxNum,
}
}
},
formatter: function (param) {
var res = '';
if(param.value >100){
res += param.value
+ '\n{img1|}'
return res;
}else {
return res;
}
},
textStyle: {
color: '#116ffc',
fontSize: '16'
}
}
},
},
{
name: "出库" + this.codeName,
type: "bar",
barWidth: 15,
data: outList,
itemStyle: {
barBorderRadius: [10, 10, 0, 0],
},
},
],