myChart.setOption(
{
title: {
show: true,
text: '完成度',
x: 'center',
textStyle: {
fontWeight: 'normal',
fontSize: 16
}
},
animation: true,
tooltip: {
show: false
},
series: [
{
name: '完成度',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
hoverAnimation: false,
silent: true,
labelLine: {
normal: {
show: false
}
},
data: [
{
value: 20,
name: '完成度',
selected: false,
label: {
normal: {
show: true,
position: 'center',
fontSize: 20,
formatter: '{b}\n{d}%'
}
},
itemStyle: {
color: '#91c7ae'
}
},
{
value: 80,
label: {
normal: {
show: false
}
},
itemStyle: {
color: '#eee'
}
}
]
}
]
}
)
效果圖