import{u}from"./use-quasar-f8m-PZpx.js";import{aK as c,a as p,r as d,w as f,o as h,e as m,a2 as x,a3 as y,aI as v}from"./index-DC_W_xoa.js";import{n as g,o as L,q as _}from"./install-BzJmHx0b.js";import{aR as A,dR as b,dS as D,dQ as S,dT as $}from"./install-DogX_3Yh.js";const q={__name:"LineCharts",props:{title:{type:String,default:"Line Chart"},xAxisData:{type:Array,required:!0},seriesData:{type:Array,required:!0},chartWidth:{type:Number,required:!0},chartHeight:{type:Number,required:!0}},setup(s){A([g,L,b,D,_,S]);const t=s,n=u(),a=p(()=>n.dark.isActive),r=d(null);let e=null;const l=()=>{if(!r.value)return;e||(e=$(r.value));const o={title:{text:t.title,left:"center",textStyle:{color:a.value?"#ffffff":"#000000"}},tooltip:{trigger:"axis"},legend:{top:"10%",textStyle:{color:a.value?"#ffffff":"#000000"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:t.xAxisData,axisLine:{lineStyle:{color:a.value?"#ffffff":"#000000"},axisLabel:{color:a.value?"#ffffff":"#000000"}}},yAxis:{type:"value"},series:t.seriesData.map(i=>({name:i.name,type:"line",smooth:!0,data:i.data,axisLine:{lineStyle:{color:a.value?"#ffffff":"#000000"}},axisLabel:{color:a.value?"#ffffff":"#000000"}}))};e.setOption(o)};return f(()=>[t.chartWidth,t.chartHeight],()=>{e&&e.resize()}),f(()=>[t.xAxisData,t.seriesData,a.value],()=>{l()},{deep:!0}),h(()=>{l()}),m(()=>{e&&(e.dispose(),e=null)}),(o,i)=>(x(),y("div",{ref_key:"chart",ref:r,style:v({width:"100%",height:`${s.chartHeight}px`})},null,4))}},H=c(q,[["__scopeId","data-v-94f06f3e"]]);export{H as L};
