import{_ as b,r as f,aA as x,o,c,v as s,F as k,A as C,O as _,x as g,n as z,bL as A}from"./index.8d733f79.js";const B=""+new URL("pie-bg.4573a032.png",import.meta.url).href;const F={class:"pie-container"},L={class:"pie-legend"},S=["onClick"],R={class:"legend-name"},W={__name:"dashboard-pieChart",emits:["pieClick","legendClick"],setup(O,{expose:u,emit:d}){let t=null;const p=f(null),h=f([]),m=(a,n)=>{t&&t.destroy(),h.value=a||[],t=A.chart(p.value,{chart:{type:"pie",backgroundColor:"transparent",events:{load(){const e=this,r=e.plotWidth/2+e.plotLeft,i=e.plotHeight/2+e.plotTop,l=e.plotWidth*.8;e.renderer.image(B,r-l/2,i-l/2,l,l).attr({rx:10,ry:10,opacity:.9}).add(),e.renderer.text(n||0,r,i).attr({style:"font-size: 20px;line-height: 28px;height: 28px;",align:"center",verticalAlign:"middle",fill:"#00F6FF"}).add(),e.renderer.text("\u8BBE\u5907\u603B\u6570/\u4E2A",r,i+22).attr({style:"font-size: 12px;line-height: 16px",align:"center",verticalAlign:"middle",fill:"#ffffff",fontWeight:"bold"}).add(),e.renderer.image()}}},credits:{enabled:!1},exporting:{enabled:!1},title:{text:""},plotOptions:{pie:{size:"80%",innerSize:"95%",allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},borderRadius:0,borderWidth:0,startAngle:10,endAngle:-350,slicedOffset:5,states:{select:{enabled:!0}},events:{click(e){d("pieClick",e,this)}}}},series:[{name:"\u8BBE\u5907\u5206\u7C7B",data:a||[]}]})},v=()=>{},y=a=>{const n=t.series[0].points.find(e=>e.name===a.name);n.select(),d("legendClick",a,n)};return x(()=>{t&&t.destroy()}),u({loadChart:m,updateChart:v}),(a,n)=>(o(),c("div",F,[s("div",{class:"chart",id:"chart",ref_key:"chartRef",ref:p},null,512),s("div",L,[(o(!0),c(k,null,C(z(h),e=>(o(),c("div",{key:e.name,class:"legend-item",onClick:r=>y(e)},[s("div",{class:"legend-color",style:_({background:e.color})},null,4),s("div",R,g(e.name),1),s("div",{class:"legend-value",style:_({color:e.color})},g(e.y),5)],8,S))),128))])]))}},w=b(W,[["__scopeId","data-v-e03882e0"]]);export{w as default};
