constpieChart=async()=>{const myChart = echarts.init(piepic.value)const piedata =awaitgetPieData();// 等待数据返回
myChart.setOption({title:{},grid:{},tooltip:{trigger:'item',},legend:{top:'middle',align:'left',icon:'circle',textStyle:{fontSize:12,padding:[0,10,0,-5]//图例文字内间距},orient:'vertical',right:10,backgroundColor:'#f7f7f7',formatter:function(name){var total =0;var tarValue;for(var i =0; i < piedata.length; i++){
total += piedata[i].value;if(name === piedata[i].name){
tarValue = piedata[i].value;}}var p = Math.round((tarValue / total)*100);return name + p +"%";},},series:[{type:'pie',radius:['40%','60%'],center:['30%','50%'],padAngle:2,label:{show:false,position:'center'},labelLine:{show:false},data:piedata,}]})}