Agriculture-front-end/dist/assets/EchartsZB.9d1980ef.js

2 lines
2.1 KiB
JavaScript
Raw Normal View History

import"./index.2809c208.js";import{_ as u,r as i,a2 as p,x as m,ah as h,o as v,c as _,q as b,s as y,l as x}from"./index.064676a5.js";import{ai as l}from"./linkSeriesData.e74eae00.js";const g=r=>(b("data-v-f518f7d9"),r=r(),y(),r),w={class:"EchartsBox"},S=g(()=>x("div",{id:"myChart3"},null,-1)),z=[S],B={__name:"EchartsZB",props:{zb:{type:Object,default:()=>[]}},setup(r){const d=r;let n=i([]),s=i(0);function c(){var o=document.getElementById("myChart3"),a=l(o);window.addEventListener("resize",function(){a.resize()});var t;t={title:{text:"\u8BBE\u65BD\u519C\u4E1A\u603B\u9762\u79EF",subtext:s.value+"\u4EA9",left:"center",top:"center",textStyle:{color:"#000",fontSize:16,fontWeight:"normal"}},tooltip:{trigger:"item",formatter:function(e){return(e.value/s.value*100).toFixed(2)==="NaN"?"\u8BBE\u65BD\u519C\u4E1A\u9762\u79EF\u5360\u6BD4<br/>"+e.name+": "+e.value+"\u4EA9<br/>\u767E\u5206\u6BD4: "+0+"%":"\u8BBE\u65BD\u519C\u4E1A\u9762\u79EF\u5360\u6BD4<br/>"+e.name+": "+e.value+"\u4EA9<br/>\u767E\u5206\u6BD4: "+(e.value/s.value*100).toFixed(2)+"%"},textStyle:{fontSize:12}},series:[{name:"\u8BBE\u65BD\u519C\u4E1A\u9762\u79EF\u5360\u6BD4",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"\u8BBE\u65BD\u519C\u4E1A\u603B\u9762\u79EF<br/>"+s.value+"\u4EA9"}}},labelLine:{show:!1},data:n.value}]},t&&a.setOption(t)}return p(()=>d.zb,(o,a)=>{let t=0;n.value=o.map((e,f)=>(t+=Number(e.nonFarm),o.length-1==f&&(s.value=t.toFixed(2)),{value:e.nonFarm,name:e.subregionName})),c()}),m(()=>{var o=document.getElementById("myChart3"),a=l(o);window.addEventListener("resize",function(){a.resize()});var t;t={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:[]}]},t&&a.setOption(t)}),h(()=>{}),(o,a)=>(v(),_("div",w,z))}},I=u(B,[["__scopeId","data-v-f518f7d9"]]);export{I as default};