2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import"./index.2809c208.js";import{_ as e,r as t,a2 as a,x as r,ad as o,o as i,c as n,q as s,s as l,l as d}from"./index.e5c8b0d6.js";import{ai as m}from"./linkSeriesData.e74eae00.js";const u={class:"EchartsBox"},f=[(e=>(s("data-v-f518f7d9"),e=e(),l(),e))((()=>d("div",{id:"myChart3"},null,-1)))],b=e({__name:"EchartsZB",props:{zb:{type:Object,default:()=>[]}},setup(e){const s=e;let l=t([]),d=t(0);return a((()=>s.zb),((e,t)=>{let a=0;var r,o,i;l.value=e.map(((t,r)=>(a+=Number(t.nonFarm),e.length-1==r&&(d.value=a.toFixed(2)),{value:t.nonFarm,name:t.subregionName}))),o=document.getElementById("myChart3"),i=m(o),window.addEventListener("resize",(function(){i.resize()})),(r={title:{text:"设施农业总面积",subtext:d.value+"亩",left:"center",top:"center",textStyle:{color:"#000",fontSize:16,fontWeight:"normal"}},tooltip:{trigger:"item",formatter:function(e){return"NaN"===(e.value/d.value*100).toFixed(2)?"设施农业面积占比<br/>"+e.name+": "+e.value+"亩<br/>百分比: 0%":"设施农业面积占比<br/>"+e.name+": "+e.value+"亩<br/>百分比: "+(e.value/d.value*100).toFixed(2)+"%"},textStyle:{fontSize:12}},series:[{name:"设施农业面积占比",type:"pie",radius:["55%","85%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!1,fontSize:26,fontWeight:"normal",formatter:function(e){return"设施农业总面积<br/>"+d.value+"亩"}}},labelLine:{show:!1},data:l.value}]})&&i.setOption(r)})),r((()=>{var e,t=document.getElementById("myChart3"),a=m(t);window.addEventListener("resize",(function(){a.resize()})),(e={tooltip:{trigger:"item"},series:[{name:"Access From",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:40,fontWeight:"bold"}},labelLine:{show:!1},data:[]}]})&&a.setOption(e)})),o((()=>{})),(e,t)=>(i(),n("div",u,f))}},[["__scopeId","data-v-f518f7d9"]]);export{b as default};
|