如何去掉echarts餅圖小數點
series : {
name : ' 票數佔比' ,
type : 'pie' ,
radius : '72%' , // 設置餅圖大小
center : [ '50%' , '58%' ], // 設置餅圖位置
label : {
// formatter: "{b}: {d}%",
// 如何去掉百分比看這裏
formatter : function (data){
// console.log(data)
let a = data. name
let b = data. percent . toFixed ( 0 ) + "%"
let c = a + ':' + b
// return a+':'+b
return c
},
color : '#333'
},
data : slef. ovetIdmaxnum ,
emphasis : {
itemStyle : {
shadowBlur : 10 ,
shadowOffsetX : 0 ,
shadowColor : 'rgba(0, 0, 0, 0.5)'
}
}
},
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.