import{i,L as l}from"./index.1703796278973314.js";import{d as c,m as p,o as d,x as f,V as h,S as m}from"./vue.1703796278973.js";import{_}from"./_plugin-vue_export-helper.1703796278973.js";const y={class:"chart",ref:"chart"},u=c({__name:"LineChart",props:{color:{type:String,default:"#498BEF"},showX:{type:Boolean,default:!1},showY:{type:Boolean,default:!1},chartData:{type:Array,default:()=>[]}},setup(s){const e=s,{proxy:r}=m(),n=()=>{h(()=>{const o=i(r.$refs.chart),a={grid:{left:"5%",right:"5%",top:"5%",bottom:"5%"},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:[{show:e.showX,boundaryGap:!1,data:e.chartData.map(t=>t.date)}],yAxis:[{show:e.showY,axisTick:{show:!1},axisLine:{show:!1},splitLine:{lineStyle:{type:"dotted"}}}],series:[{name:"流量消耗",type:"line",symbol:"circle",showSymbol:!1,smooth:!0,itemStyle:{normal:{color:e.color,lineStyle:{color:e.color,width:1},areaStyle:{color:new l(0,1,0,0,[{offset:.1,color:"#fff"},{offset:1,color:e.color}])}}},data:e.chartData.map(t=>t.value&&t.value.toFixed(2))}]};o.setOption(a),window.addEventListener("resize",function(){o.resize()})})};return p(()=>e.chartData,()=>n(),{immediate:!0,deep:!0}),(o,a)=>(d(),f("div",y,null,512))}});const g=_(u,[["__scopeId","data-v-7a7451d2"]]);export{g as default};