想让文字默认就显示,给这个normal设置为true,让文字在圈的中间显示,position:inner,这个position的值也可以设置为center,left等等
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
myChart.setOption({
tooltip: {
trigger: 'item',
formatter: "{b}: {c} ({d}%)"
},
color: ["#f7941d", "#e0483e", "#2bb0ee"],
series: [{
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
position: 'inner',
textStyle: {
fontSize: '12',
fontWeight: 'bold'
}
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data: [{
value: 2321,
name: '计划开展'
},
{
value: 653,
name: '已开展'
},
{
value: 1363,
name: '未开展'
}
]
}]
});