代码如下:
option = {
//1 非常重要 #168AEB 2 重要 #FFA258 3 一般 #EC6678
tooltip: {
show:false,
trigger: 'item',
},
color: ['#168AEB', '#FFA258'],
series: [
{
name:'非常重要',
type:'pie',
radius: ['40%', '45%'],
//环的位置
label: {
show: false,
position: 'center',
},
data:[
{
value:70, //需要显示的数据
name: '非常重要',
itemStyle: {
normal: {
color: '#168AEB'
}
}
},
{
value:100,
//不需要显示的数据,颜色设置成和背景一样
itemStyle: {
normal: {
color: '#E9E9E9'
}
}
}
]
},
{
name:'重要',
type:'pie',
radius: ['30%', '35%'],
label: {
show: false,
position: 'center',
},
data:[
{ name:'重要',
value:60,
itemStyle: {
normal: {
color: '#FFA258'
}
}
},
{
value:100-60,
itemStyle: {
normal: {
color: '#E9E9E9'
}
}
}
]
},
{
name:'一般',
type:'pie',
radius: ['20%', '25%'],
label: {
show: false,
position: 'center',
},
data:[
{ name:'一般',
value:20,
itemStyle: {
normal: {
color: '#EC6678'
}
}
},
{
value:100-20,
itemStyle: {
normal: {
color: '#E9E9E9'
}
}
}
]
}
]
};
效果来了:
image.png