import{i as p}from"./index-06v0hgpB.js";import{d as f,r as o,o as m,e as h,a as x,c as C}from"./index-wyO9_XA2.js";const b=f({__name:"KoiPieChart",setup(g){const i=o(),a=o(),l=o([{value:5,name:"AABB故障"},{value:6,name:"CCDD故障"},{value:7,name:"TTZZ故障"},{value:8,name:"GGHH故障"},{value:9,name:"YYXX故障"}]),n=o();m(()=>{d(),c(),r(),window.addEventListener("resize",r),s()}),h(()=>{a.value.dispose(),a.value=null,clearInterval(n.value),n.value=null,window.removeEventListener("resize",r)});const d=()=>{var e;a.value=p(i.value);const t={tooltip:{confine:!0,trigger:"item"},legend:{orient:"vertical",left:"left",extraCssText:"z-index: 999"},series:[{name:"模块故障",type:"pie",radius:["45%","70%"],center:["60%","50%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center",formatter:"{d}%"},emphasis:{label:{show:!0,fontSize:"16",fontWeight:"bold"}},labelLine:{show:!1}}]};(e=a.value)==null||e.setOption(t),a.value.on("mouseover",()=>{clearInterval(n.value)}),a.value.on("mouseout",()=>{s()})},c=()=>{v()},v=()=>{var e;const t={series:[{data:l.value}]};(e=a.value)==null||e.setOption(t)},r=()=>{var e,u;const t={legend:{textStyle:{fontSize:12}}};(e=a.value)==null||e.setOption(t),(u=a.value)==null||u.resize()},s=()=>{let t=0;n.value=setInterval(()=>{a.value.dispatchAction({type:"showTip",position:function(e){return{left:e[0]+10,top:e[1]-10}},seriesIndex:0,dataIndex:t}),t++,t>l.value.length&&(t=0)},2e3)};return(t,e)=>(x(),C("div",{ref_key:"refChart",ref:i,style:{width:"100%",height:"350px"}},null,512))}});export{b as default};