横向柱图,Y轴描述可以限制固定宽度吗并且超出用...显示吗?
配置项如下
option = {
title: {
text: 'BUG驳回率排名',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['驳回率', '创建率']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
yAxis: {
type: 'category',
// 这儿data里的值可以设固定宽度 吗 并超出 用...显示
data: ['XX11111111111111111111111111某1','XX某2','XX某3','XX某4','XX某5','XX某', 'XX某6','XX某7','XX某8','XX某9'],
axisLabel: {
show: true,
interval: 'auto',
formatter: function (name) {
return echarts.format.truncateText(name, 40, '14px Microsoft Yahei', '…');
},
}
},
series: [
{
name: '驳回率',
type: 'bar',
itemStyle: {
normal: {
label: {
textStyle: {
color: '#000000',
fontSize: 3
},
show: true,
position: 'right',
formatter: '{c}%',
}
}
},
data: [8, 13, 15, 17, 22, 24, 28, 31, 35, 37],
},
{
name: '创建率',
type: 'bar',
itemStyle: {
normal: {
color: '#ADADAD',
label: {
textStyle: {
color: '#000000',
fontSize: 3
},
show: true,
position: 'right',
formatter: '{c}%',
}
}
},
data: [9, 21, 13, 22, 13, 16, 13, 15, 17, 22]
}
]
};