Agriculture-front-end/dist/assets/EchartsHNT.e29382a8.js

2 lines
1.6 KiB
JavaScript
Raw Normal View History

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