1.代码
const option = {
tooltip: {
trigger: 'item',
},
color: colorArr,
// legend: {
// icon: 'circle',
// // top: '20%',
// left: '20%',
// width: 300,
// itemGap: 20,
// formatter(param) {
// const item = dataList.find(o => o.subBizTypeName === param)
// return '{a|' + param + ' ' + item.qty + '}';
// },
// textStyle: {
// rich: {
// a: {
// width: 150,
// display: 'inline-block',
// }
// }
// }
// },
series: [
{
type: 'pie',
minAngle: 60,
radius: ['70%', '86%'],
center: ['12%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
position: 'center',
color: '#4c4a4a',
// formatter: `{active|${bizTypeName}`,
formatter: (param) => {
console.log('aaaa', param);
return `${bizTypeName}`;
},
rich: {
desc: {
color: 'var(--gray-gray-10, #262626)',
fontFamily: 'Microsoft YaHei',
fontSize: 10,
fontStyle: 'normal',
fontWeight: 400,
lineHeight: 'normal',
},
},
},
},
data: dataList,
},
],
};