import{i as n}from"./index.1703796278973314.js";import{d as l,l as c,k as u,m,W as f,V as p,o as v,x as d,S as h}from"./vue.1703796278973.js";const A=l({__name:"Pie",props:{chartRef:String,value:Number,image:String,colorArr:Array},setup(i){const e=i,{proxy:r}=h(),a=c(()=>({color:e.colorArr||["#D3ADF7","#979AFF"],graphic:[{type:"image",style:{image:e.image||"",width:16,height:16},left:"center",top:"41%"}],series:[{type:"pie",radius:["100%","60%"],center:["50%","50%"],label:{show:!1},data:[100-(e.value||0),e.value],itemStyle:{borderColor:"#fff",borderWidth:2}}]})),t=u();m(a,()=>{t.value?t.value.setOption(a.value):s()}),f(()=>{window.removeEventListener("resize",o)});const o=()=>{t.value&&t.value.resize()},s=()=>{p(()=>{t.value=n(r==null?void 0:r.$refs[e.chartRef]),t.value.setOption(a.value),window.addEventListener("resize",o)})};return s(),(g,w)=>(v(),d("div",{ref:e.chartRef},null,512))}});export{A as _};
