"use strict";(globalThis["webpackChunkuniqua"]=globalThis["webpackChunkuniqua"]||[]).push([[264],{2264:(t,a,e)=>{e.r(a),e.d(a,{default:()=>m});var i=e(1758);const s={class:"fit"};function o(t,a,e,o,n,l){return(0,i.uX)(),(0,i.CE)("div",s,[((0,i.uX)(),(0,i.Wv)((0,i.$y)(n.VChartAsync),{ref:"chart","manual-update":!0,onClick:l.clicked,autoresize:!0},null,8,["onClick"]))])}e(8499);var n=e(4907),l=e(3952),h=e(8734);let r=["","#80FFA5","#00DDFF","#37A2FF","#FF0087","#FFBF00","rgba(128, 255, 165)","rgba(77, 119, 255)"];const d={name:"linechart",props:{data:Object,pdata:Object},data(){const t=(0,n.A)();return{$q:t,model:!1,animation:null,markPoint:null,options:{responsive:!0,maintainAspectRatio:!1,legend:{data:[],bottom:10,textStyle:{color:"#4DD0E1"}},tooltip:{trigger:"axis",position:function(t){return[t[0],"10%"]}},title:{left:"center",text:""},toolbox:{feature:{}},xAxis:{type:"category",boundaryGap:!1,data:null},yAxis:{type:"value",boundaryGap:[0,"100%"]},dataZoom:[{type:"inside",start:0,end:10},{start:0,end:10}],series:[]},VChartAsync:null}},methods:{async loadChartComponents(){const[{default:t},a]=await Promise.all([Promise.all([e.e(121),e.e(464)]).then(e.bind(e,6581)),Promise.all([e.e(121),e.e(464)]).then(e.bind(e,1879))]);this.VChartAsync=(0,h.IG)(t),this.echarts=a},setOptions(){this.$refs.chart&&this.$refs.chart.setOption(this.options)},processCoord(t,a,e){let i=null;for(let e of a)if(t[0]==e.coord[0]){i=e;break}e?i?a.splice(a.indexOf(i),1):a.push({coord:t}):(a.splice(0,a.length),i||a.push({coord:t}))},clicked(t){if(this.data.option)return void(0,l.tN)([this.pdata.name,this.data.name,"changed",t.value]);let a=[t.dataIndex,this.options.series[t.seriesIndex].data[t.dataIndex]];this.processCoord(a,this.markPoint.data,l.Zp.shiftKey);let e=this.markPoint.data.map((t=>t.coord[0])),i=this.data;if(i.value=Array.isArray(i.value)||e.length>1?e:e.length?e[0]:null,this.animation){let t=this.options.dataZoom;t[0].start=this.animation.start,t[1].start=this.animation.start,t[0].end=this.animation.end,t[1].end=this.animation.end}this.setOptions(),(0,l.tN)([this.pdata.name,this.data.name,"changed",this.data.value])},calcSeries(){this.options.toolbox.feature.mySwitcher={show:!0,title:"Switch view to the table",icon:"image:M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z",onclick:()=>{let t=this.data;t.type="table",t.tablerect=this.$refs.chart.$el.getBoundingClientRect()}};let t=this.data.view,a=this.data.headers;"_"!=this.data.name[0]&&(this.options.title.text=this.data.name);let e=t.split("-"),i=e[1].split(",");i.unshift(e[0]);let s=[];for(let t=0;t<i.length;t++)i[t]="i"==i[t]?-1:parseInt(i[t]),s.push([]),t&&(this.options.series.push({name:a[i[t]],type:"line",symbol:"circle",symbolSize:10,sampling:"lttb",itemStyle:{color:r[t]},data:s[t]}),this.options.legend.data.push(a[i[t]]));this.options.xAxis.data=s[0];let o=this.data.rows;for(let t=0;t<o.length;t++)for(let a=0;a<i.length;a++)s[a].push(-1==i[a]?t:o[t][i[a]]);if(this.options.series[1]){let t=[],a=this.options.series[1].data,e=Array.isArray(this.data.value)?this.data.value:null===this.data.value?[]:[this.data.value];for(let i=0;i<e.length;i++)this.processCoord([e[i],a[e[i]]],t,!0);this.markPoint={symbol:"rect",symbolSize:10,animationDuration:300,silent:!0,label:{color:"#fff"},itemStyle:{color:"blue"},data:t},this.options.series[1].markPoint=this.markPoint}this.setOptions()}},async mounted(){if(await this.loadChartComponents(),this.data.option)this.options=this.data.option,this.setOptions();else{this.calcSeries();let t=this;this.$refs.chart.chart.on("datazoom",(function(a){(a.start||a.end)&&(t.animation=a)}))}}};var c=e(2807);const p=(0,c.A)(d,[["render",o]]),m=p}}]);