import{_ as p,r as y,C as m,o as w,c as S,m as I,O as g}from"./index.82404a61.js";const v={__name:"echart",props:["data"],emits:["select-echart"],setup(i,{expose:d,emit:u}){const{data:{xdata:x,data:h,color:o,name:s,data1:n,namme1:_}}=i,c=y(null);let r=null,a=-1;console.log(n,"data1");const f=()=>{const t=g(c.value);r=t,window.addEventListener("resize",()=>{t.resize()}),t.setOption({title:{text:s,textStyle:{align:"center",color:"#000",fontSize:13},top:"3%",left:"10%"},grid:{top:"12%",right:"5%",left:"5%",bottom:"0%",containLabel:!0},backgroundColor:"#f7f9fc",tooltip:{text:"1212",trigger:"axis",axisPointer:{type:"shadow",label:{show:!0}}},xAxis:{data:x,axisLine:{show:!0},axisTick:{show:!0},axisLabel:{show:!0,textStyle:{color:"#000",fontSize:14}},splitArea:{show:!0,areaStyle:{}}},yAxis:[{type:"value",minInterval:1,nameTextStyle:{fontSize:14},splitLine:{show:!1},axisTick:{show:!0},axisLine:{show:!0,lineStyle:{width:2}},axisLabel:{show:!0,textStyle:{color:"#000",fontSize:14}}}],series:[{name:s,type:"bar",select:{itemStyle:{borderWidth:2}},selectedMode:!0,barWidth:15,color:o,data:h},{name:_,type:"bar",select:{itemStyle:{borderWidth:2,color:"#ddd"}},selectedMode:!0,barWidth:15,color:o,data:n}]}),t.on("click",e=>{console.log(e);const l=a;u("select-echart",{name:l===e.dataIndex?"":e.name,callback:()=>{l!==e.dataIndex&&(a=e.dataIndex,t.dispatchAction({type:"select",dataIndex:e.dataIndex}))}})})};function b(){a!==-1&&(r.dispatchAction({type:"unselect",dataIndex:a}),a=-1)}return m(()=>{f()}),d({restSelect:b}),(t,e)=>(w(),S("div",null,[I("div",{ref_key:"assetEchart",ref:c,class:"asset_echart"},null,512)]))}},L=p(v,[["__scopeId","data-v-bb0b9cc9"]]);export{L as default};