在使用echarts 环形图时,有时候我们开发需要 环形图 中间默认显示我们需要的数据,我们可以这样改一下代码;
改之前:
修改之后:
修改代码如下:
normal: {
show: true,
position: 'center',
formatter:function(){
return ' 1023.33万\r\n 北京'
},
textStyle:{
fontSize:40,
color:"#666"
}
},
emphasis: {
show: false,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
这样就可以了哦