2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
|
import"./index.2809c208.js";import{_ as u,r as h,a7 as p,x,o as _,c as m,q as g,s as v,l as b}from"./index.064676a5.js";import{ai as y,aj as f}from"./linkSeriesData.e74eae00.js";const w=o=>(g("data-v-14fba62b"),o=o(),v(),o),A={class:"EchartsBox"},I=w(()=>b("div",{id:"myChart2"},null,-1)),S=[I],k={__name:"EchartsHNT",props:{heightArr:{type:Array,default:()=>[]}},setup(o){const s=o;let l=h([]),d=h([]);return p(()=>{console.log(s.heightArr,"heightArr"),s.heightArr.length>0&&(l.value=s.heightArr.map((t,e)=>({value:t.subregionName||"",textStyle:{fontSize:12,fontWeight:400,width:80,overflow:"break"}})),d.value=s.heightArr.map((t,e)=>t.nonFarm||0))}),x(()=>{var t=document.getElementById("myChart2"),e=y(t);window.addEventListener("resize",function(){e.resize()});var i;let r=l.value,n=d.value;for(let a=0;a<n.length;a++);i={title:{text:"",subtext:""},tooltip:{show:!0,trigger:"axis"},xAxis:{data:r,axisLabel:{inside:!1,color:"#aaa"},axisTick:{show:!1},axisLine:{show:!1},z:10},yAxis:{name:"\u9762\u79EF\uFF08\u4EA9\uFF09",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#999"}},dataZoom:[{type:"inside"}],series:[{type:"bar",showBackground:!0,itemStyle:{color:new f(0,0,0,1,[{offset:0,color:"#aee7be"},{offset:.5,color:"#c2ebcf"},{offset:1,color:"#d6f0e1"}])},emphasis:{itemStyle:{color:new f(0,0,0,1,[{offset:0,color:"#8cd8a1"},{offset:.7,color:"#a1dcb2"},{offset:1,color:"#caefd5"}])}},data:n}]};const c=6;e.on("click",function(a){console.log(r[Math.max(a.dataIndex-c/2,0)]),e.dispatchAction({type:"dataZoom",startValue:r[Math.max(a.dataIndex-c/2,0)],endValue:r[Math.min(a.dataIndex+c/2,n.length-1)]})}),i&&e.setOption(i)}),(t,e)=>(_(),m("div",A,S))}},L=u(k,[["__scopeId","data-v-14fba62b"]]);export{L as default};
|