ui中做出这种效果

series : [
{
name: '客户开通情况',
type: 'pie',
radius : ['50%', '70%'],
center: ['50%', '50%'],
data: this.chart5,
label:{
show: true,
normal: {
formatter: "{b}\n{c}个",
align: 'center',
rich: {
b: {
color: '#313131',
fontSize: 12,
lineHeight: 20,
align: 'center',
},
c: {
color: '#313131',
align: 'center',
fontSize: 16,
lineHeight: 20,
},
x: {
color: '#999999',
align: 'left',
fontSize: 14,
lineHeight: 24
}
}
},
},
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
本来是i这样写的,但是写出来的很不符合ui的样式,后来查看了文档,可以写成这样
formatter: '{b|{b}:} \n {c|{c}} {x|个} ‘
这个’|‘前面的是样式,’|‘后面的是文字,这样我就可以把一个label里的文字设置成不同的样式了。mark下
网友评论