吐槽一下,echarts的配置项实在是太严格了。。
先贴问题和代码:
// series配置:
{
type: 'pie',
radius: ['50%'],
avoidLabelOverlap: false,
label: {
show: true, // 明明已经设置了
position: 'outside',
},
emphasis: {
label: {
show: true,
margin: '25%',
formatter: '{name|{b}}:{value|{c}%}',
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
}
}
}
},
labelLine: { // 这个也没毛病啊
length: 15,
length2: 25,
maxSurfaceAngle: 80,
},
最后找了一阵子,发现竟然是radius: [‘50%’] ,多了个中括号!!
去掉中括号,就该这样嘛。如果想要空心圆,才要加上中括号放两组数据。没想到跟label显示有关系