效果如图:
代码如下:
{
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
graphic: {
elements: [
{
type: 'image',
style: {
image: "https://gitee.com/Frankenstein4/tc/raw/master/wangluoshebei.png",//自定义图片,网络图片
width: 25,
height: 30
},
left: 'center',
top: 'center'
},
series: [{
name:'比例',
type: 'pie',
radius: ['45%', '50%'],//在这里配置外半径值,和外半径可视部分的大小
center: ['50%', '50%'],
hoverAnimation:false,//鼠标放上去不悬浮变大
color: ['#32A179', '#D8D8D8', '#E271DE', '#F8456B', '#00FFFF', '#4AEAB0'],
data: [
{value:350, name:'在线数量'},
{value:71, name:'离线数量'},
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
}]
}