import{u as c}from"./useECharts-XZ1IwN24.js";import{d as f,r as x,aw as F,h as g,o as p,aG as v}from"./index-9PRMimni.js";const y=f({__name:"AreaRanking",props:{width:{type:String,default:"100%"},height:{type:String,default:"350px"}},setup(r){let a=[{name:"四川省",value:(Math.random()*10).toFixed(0),sum:10},{name:"江西省",value:(Math.random()*10).toFixed(0),sum:10},{name:"湖南省",value:(Math.random()*10).toFixed(0),sum:10},{name:"浙江省",value:(Math.random()*10).toFixed(0),sum:10},{name:"广东省",value:(Math.random()*10).toFixed(0),sum:10},{name:"山西省",value:(Math.random()*10).toFixed(0),sum:10},{name:"上海市",value:(Math.random()*10).toFixed(0),sum:10},{name:"江苏省",value:(Math.random()*10).toFixed(0),sum:10},{name:"福建省",value:(Math.random()*10).toFixed(0),sum:10},{name:"河南省",value:(Math.random()*10).toFixed(0),sum:10}];const o=(e,t)=>{let m=t,s=[];return e&&e.forEach(function(h){s.push(h[m])}),s},n={index:0},d=["#FC619D","#FF904D","#48BFE3"];a=a.sort((e,t)=>t.value-e.value);const l={grid:{top:"2%",bottom:-15,right:30,left:-30,containLabel:!0},xAxis:{show:!1},yAxis:[{triggerEvent:!0,show:!0,inverse:!0,data:o(a,"name"),axisLine:{show:!1},splitLine:{show:!1},axisTick:{show:!1},axisLabel:{interval:0,color:"#666",align:"left",margin:80,fontSize:13,formatter:function(e,t){return t<3?"{idx"+t+"|"+(1+t)+"} {title|"+e+"}":"{idx|"+(1+t+n.index)+"} {title|"+e+"}"},rich:{idx0:{color:"#FB375E",backgroundColor:"#FFE8EC",borderRadius:100,padding:[5,8]},idx1:{color:"#FF9023",backgroundColor:"#FFEACF",borderRadius:100,padding:[5,8]},idx2:{color:"#01B599",backgroundColor:"#E1F7F3",borderRadius:100,padding:[5,8]},idx:{color:"#333",borderRadius:100,padding:[5,8]},title:{width:165}}}},{triggerEvent:!0,show:!0,inverse:!0,data:o(a,"name"),axisLine:{show:!1},splitLine:{show:!1},axisTick:{show:!1},axisLabel:{interval:0,color:"#666",align:"left",margin:20,fontSize:13,formatter:function(e,t){return"转化率："+(a[t]?.value/a[t].sum*100).toFixed(2)+"%"}}}],series:[{name:"条",type:"bar",yAxisIndex:0,data:a,barWidth:10,itemStyle:{color:e=>e.dataIndex<3&&n.index===0?d[e.dataIndex]:"#1990FF",borderRadius:30}}]},i=x(null),{setOptions:u}=c(i);return F(()=>{u(l)}),(e,t)=>(p(),g("div",{ref_key:"chartRef",ref:i,style:v({height:r.height,width:r.width})},null,4))}});export{y as _};
