import{d as u,e as l,U as y,a2 as f,a3 as p,G as g,a5 as c,a4 as d,k as _,a6 as x,f as v,r as b,h as S,ac as $}from"./vue-vendor-CxLCUzY4.js";import{_ as h}from"./index-B_2CoVdl.js";import{useECharts as C}from"./useECharts-DCjNtWia.js";import{h as w}from"./antd-vue-vendor-CDWW6V_M.js";const D=u({name:"Trend",props:{term:{type:String,default:"",required:!0},percentage:{type:Number,default:null},type:{type:Boolean,default:null},target:{type:Number,default:0},value:{type:Number,default:0},fixed:{type:Number,default:2}},setup(e){const a=l(()=>(e.type===null?e.value>=e.target:e.type)?"up":"down"),n=l(()=>(e.percentage===null?Math.abs(e.value-e.target)*100/e.target:e.percentage).toFixed(e.fixed));return{trend:a,rate:n}}}),N={class:"chart-trend"};function A(e,a,n,r,t,o){const s=y("Icon");return f(),p("div",N,[g(c(e.term)+" ",1),d("span",null,c(e.rate)+"%",1),d("span",{class:x(["trend-icon",e.trend])},[_(s,{icon:"ant-design:caret-"+e.trend+"-outlined"},null,8,["icon"])],2)])}const V=h(D,[["render",A],["__scopeId","data-v-a2064e4e"]]),k=u({name:"single-line",props:{chartData:{type:Array,default:()=>[]},option:{type:Object,default:()=>({})},width:{type:String,default:"100%"},height:{type:String,default:"calc(100vh - 78px)"},seriesColor:{type:String,default:"#1890ff"}},setup(e){const a=v(null),{setOptions:n,echarts:r}=C(a),t=b({tooltip:{trigger:"axis",axisPointer:{type:"shadow",label:{show:!0,backgroundColor:"#333"}}},xAxis:{type:"category",data:[]},yAxis:{type:"value"},series:[{type:"line",showSymbol:!1,smooth:!0,areaStyle:{},data:[],color:e.seriesColor}]});S(()=>{e.chartData&&o()});function o(){e.option&&Object.assign(t,w(e.option));let s=e.chartData.map(i=>i.value),m=e.chartData.map(i=>i.name);t.series[0].data=s,t.series[0].color=e.seriesColor,t.xAxis.data=m,n(t)}return{chartRef:a}}});function B(e,a,n,r,t,o){return f(),p("div",{ref:"chartRef",style:$({height:e.height,width:e.width})},null,4)}const j=h(k,[["render",B]]);export{j as S,V as T};
