vue-data-ui-hq
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 30.1 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-ZfICPrrM.cjs"),te=require("./useNestedProp-C14rfl0j.cjs"),le=require("./usePrinter-B-gh2f22.cjs"),be=require("./PackageVersion-D3dK8oA3.cjs"),Ce=require("./Legend-HgHPyA_4.cjs"),Be=require("./Title-FbHK83tB.cjs"),we=require("./Tooltip-C7TJODUx.cjs"),Se=require("./DataTable-CC6dPSer.cjs"),_e=require("./vue-ui-accordion-Dp6uTsJi.cjs"),Ne=require("./PenAndPaper-PL3bp4ud.cjs"),ze=require("./vue-ui-skeleton-Bvmpr51u.cjs"),re=require("./useResponsive-BJ7DTGpm.cjs"),Le=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=["id"],Me=["xmlns","viewBox"],Te=["x","y","width","height"],Ae={key:1},Pe=["id"],Ve=["stop-color"],Fe=["stop-color"],De=["stop-color"],Oe={key:2},Ie=["x1","x2","y1","y2","stroke","stroke-width"],Xe={key:3},Ye=["x","y","fill","font-size"],qe=["transform","font-size","fill","font-weight"],je={key:5},Ue=["x1","x2","y1","y2","stroke","stroke-width"],Re={key:6},He=["transform","fill","font-size","text-anchor"],We=["x","y","font-size","fill","font-weight"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],Je=["d","stroke","stroke-width"],Ke=["d","stroke","stroke-width"],Qe=["cx","cy","fill","r"],et=["cx","cy","fill","r","stroke","stroke-width"],tt={key:1},lt=["x","y","font-size","fill","font-weight"],rt={key:2},ot=["x","y","font-size","font-weight","fill"],at=["cx","cy","r","onMouseenter","onClick"],nt={key:5,class:"vue-data-ui-watermark"},st=["onClick"],it=["innerHTML"],ut={__name:"vue-ui-history-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(oe,{expose:ae,emit:ne}){const{vue_ui_history_plot:se}=n.useConfig(),c=oe,k=e.ref(null),M=e.ref(null),T=e.ref(0),A=e.ref(null),P=e.ref(0),V=e.ref(0),F=e.ref(0),B=e.ref(null),D=e.ref(null),b=e.ref(n.createUid()),N=e.ref(!1),z=e.ref(""),h=e.ref([]),w=e.ref(!1),m=e.ref(null),C=e.ref(!1),O=e.ref(null),y=e.computed({get:()=>!!c.dataset&&c.dataset.length,set:l=>l}),I=ne;e.onMounted(X),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});function X(){if(n.objectIsEmpty(c.dataset)?n.error({componentName:"VueUiHistoryPlot",type:"dataset"}):c.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(r=>{y.value=!1,n.error({componentName:"VueUiHistoryPlot",type:"datasetSerieAttribute",property:r,index:o})})}),t.value.responsive){const l=re.throttle(()=>{const{width:o,height:r}=re.useResponsive({chart:k.value,title:t.value.style.chart.title.text?M.value:null,noTitle:D.value,legend:t.value.style.chart.legend.show?A.value:null,source:O.value});f.value.width=o,f.value.height=r,i.value.plots=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.plots.radius,threshold:3,fallback:3}),i.value.indexLabels=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.plots.indexLabels.fontSize,threshold:6,fallback:6}),i.value.labels=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.plots.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisLabels=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.axes.x.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisName=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.axes.x.name.fontSize,threshold:6,fallback:6}),i.value.yAxisLabels=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.axes.y.labels.fontSize,threshold:6,fallback:6}),i.value.yAxisName=n.translateSize({relator:Math.min(o,r),adjuster:600,source:t.value.style.chart.axes.y.name.fontSize,threshold:6,fallback:6})});B.value=new ResizeObserver(l),B.value.observe(k.value.parentNode)}}function Y(){const l=te.useNestedProp({userConfig:c.config,defaultConfig:se});let o={};return l.theme?o={...te.useNestedProp({userConfig:n.themes.vue_ui_history_plot[l.theme]||c.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:o=l,c.config&&n.hasDeepProperty(c.config,"style.chart.axes.x.scaleMin")?o.style.chart.axes.x.scaleMin=c.config.style.chart.axes.x.scaleMin:o.style.chart.axes.x.scaleMin=null,c.config&&n.hasDeepProperty(c.config,"style.chart.axes.x.scaleMax")?o.style.chart.axes.x.scaleMax=c.config.style.chart.axes.x.scaleMax:o.style.chart.axes.x.scaleMax=null,c.config&&n.hasDeepProperty(c.config,"style.chart.axes.y.scaleMin")?o.style.chart.axes.y.scaleMin=c.config.style.chart.axes.y.scaleMin:o.style.chart.axes.y.scaleMin=null,c.config&&n.hasDeepProperty(c.config,"style.chart.axes.y.scaleMax")?o.style.chart.axes.y.scaleMax=c.config.style.chart.axes.y.scaleMax:o.style.chart.axes.y.scaleMax=null,o}const t=e.computed({get:()=>Y(),set:l=>l}),{userOptionsVisible:L,setUserOptionsVisibility:q,keepUserOptionState:j}=Le.useUserOptionState({config:t.value});e.watch(()=>c.config,l=>{t.value=Y(),L.value=!t.value.showOnChartHover,X(),T.value+=1,V.value+=1,P.value+=1,f.value.height=t.value.style.chart.height,f.value.width=t.value.style.chart.width,i.value.plots=t.value.style.chart.plots.radius,i.value.indexLabels=t.value.style.chart.plots.indexLabels.fontSize,i.value.labels=t.value.style.chart.plots.labels.fontSize,i.value.xAxisLabels=t.value.style.chart.axes.x.labels.fontSize,i.value.xAxisName=t.value.style.chart.axes.x.name.fontSize,i.value.yAxisLabels=t.value.style.chart.axes.y.labels.fontSize,i.value.yAxisName=t.value.style.chart.axes.y.name.fontSize},{deep:!0});const{isPrinting:U,isImaging:R,generatePdf:H,generateImage:W}=le.usePrinter({elementId:`history_plot_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-history-plot"}),ie=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),x=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),f=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),s=e.computed(()=>{const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:f.value.width-t.value.style.chart.padding.right,bottom:f.value.height-t.value.style.chart.padding.bottom,width:f.value.width-l-t.value.style.chart.padding.right,height:f.value.height-o-t.value.style.chart.padding.bottom}}),i=e.ref({plots:t.value.style.chart.plots.radius,indexLabels:t.value.style.chart.plots.indexLabels.fontSize,labels:t.value.style.chart.plots.labels.fontSize,xAxisLabels:t.value.style.chart.axes.x.labels.fontSize,xAxisName:t.value.style.chart.axes.x.name.fontSize,yAxisLabels:t.value.style.chart.axes.y.labels.fontSize,yAxisName:t.value.style.chart.axes.y.name.fontSize}),v=e.computed(()=>y.value?c.dataset.map((l,o)=>({...l,color:l.color?n.convertColorToHex(l.color):ue.value[o]||n.palette[o]||n.palette[o%n.palette.length],seriesIndex:o})):[]),ce=e.computed(()=>y.value?Math.max(...v.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.x))):1),fe=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...v.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(r=>r.x)));return l<0?l:0}),de=e.computed(()=>y.value?Math.max(...v.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.y))):1),he=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...v.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(r=>r.y)));return l<0?l:0}),d=e.computed(()=>{const l=n.calculateNiceScale(t.value.style.chart.axes.x.scaleMin===null?fe.value:t.value.style.chart.axes.x.scaleMin,t.value.style.chart.axes.x.scaleMax===null?ce.value:t.value.style.chart.axes.x.scaleMax,t.value.style.chart.axes.x.ticks),o=n.calculateNiceScale(t.value.style.chart.axes.y.scaleMin===null?he.value:t.value.style.chart.axes.y.scaleMin,t.value.style.chart.axes.y.scaleMax===null?de.value:t.value.style.chart.axes.y.scaleMax,t.value.style.chart.axes.y.ticks);return{x:l,y:o,tickX:l.ticks.map(r=>({x:s.value.left+(r-l.min)/(l.max-l.min)*s.value.width,y1:s.value.top,y2:s.value.bottom,value:r})),tickY:o.ticks.map(r=>({y:s.value.bottom-(r-o.min)/(o.max-o.min)*s.value.height,x1:s.value.left,x2:s.value.right,value:r}))}});function ye(l){const o=d.value.x.min<0?Math.abs(d.value.x.min):d.value.x.min>0?-d.value.x.min:0;return s.value.left+((l||0)+o)/(d.value.x.max+o)*s.value.width}function pe(l){const o=d.value.y.min<0?Math.abs(d.value.y.min):d.value.y.min>0?-d.value.y.min:0;return s.value.bottom-((l||0)+o)/(d.value.y.max+o)*s.value.height}const g=e.computed(()=>v.value.filter(l=>!h.value.includes(l.seriesIndex)).map((l,o)=>{const r=l.values.map((a,p)=>({valueX:a.x,valueY:a.y,label:a.label,x:ye(a.x),y:pe(a.y),color:l.color,seriesName:l.name,id:n.createUid()})),u=r.map(a=>`${a.x},${a.y} `).join("").trim();return{...l,plots:r,path:`M${u}`}}));function G(l){h.value.includes(l)?h.value=h.value.filter(o=>o!==l):h.value.push(l)}const Z=e.computed(()=>v.value.map(l=>({...l,opacity:h.value.includes(l.seriesIndex)?.5:1,segregate:()=>G(l.seriesIndex),isSegregated:h.value.includes(l.seriesIndex),shape:"circle"}))),me=e.computed(()=>({cy:"history-plot-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function xe(l){I("selectDatapoint",l)}function J(l){I("selectLegend",{...l,isSegregated:!l.isSegregated,opacity:l.isSegregated?1:.5})}function ve(l){w.value=l,F.value+=1}const $=e.ref(null);function ge({datapoint:l,plotIndex:o,seriesIndex:r}){$.value={datapoint:l,seriesIndex:r,plotIndex:o,config:t.value,series:v.value},m.value=l;const u=t.value.style.chart.tooltip.customFormat;if(C.value=!1,n.isFunction(u))try{const a=u({seriesIndex:r,datapoint:l,plotIndex:o,series:v.value,config:t.value});typeof a=="string"&&(z.value=a,C.value=!0)}catch{console.warn("Custom format cannot be applied."),C.value=!1}if(!C.value){let a="";a+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg><span>${l.seriesName}</span></div>`,a+=`<div>${l.label}</div>`,a+=`<div>${t.value.style.chart.axes.x.name.text||"x"}: ${n.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,l.valueX,n.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:l.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding}))}</div>`,a+=`<div>${t.value.style.chart.axes.y.name.text||"y"}: ${n.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,l.valueY,n.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:l.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))}</div>`,z.value=`<div>${a}</div>`}N.value=!0}e.computed(()=>({head:g.value.map(o=>({name:o.name,color:o.color}))}));const S=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.datapoint,t.value.table.columnNames.x,t.value.table.columnNames.y],o=g.value.flatMap(u=>u.plots.map(a=>[{color:a.color,name:a.seriesName},a.label,n.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,a.valueX,n.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:a.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding})),n.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,a.valueY,n.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:a.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))])),r={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:l,body:o,config:r,colNames:l}});function K(){e.nextTick(()=>{const l=[[t.value.table.columnNames.series],[t.value.table.columnNames.datapoint],[t.value.table.columnNames.x],[t.value.table.columnNames.y]],o=g.value.flatMap(a=>a.plots.map(p=>[[p.seriesName],[p.label],[p.valueX],[p.valueY]])),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],l].concat(o),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-history-plot"})})}const _=e.ref(!1);function E(){_.value=!_.value}function Q(){x.value.showTable=!x.value.showTable}function ee(){x.value.showTooltip=!x.value.showTooltip}function ke(){return g.value}return ae({getData:ke,generatePdf:H,generateCsv:K,generateImage:W,toggleTable:Q,toggleTooltip:ee,toggleAnnotator:E}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{id:`history_plot_${e.unref(b)}`,ref_key:"historyPlotChart",ref:k,class:e.normalizeClass({"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":e.unref(w)}),style:e.normalizeStyle(`background:${e.unref(t).style.chart.backgroundColor};color:${e.unref(t).style.chart.color};font-family:${e.unref(t).style.fontFamily}; position: relative; ${e.unref(t).responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(q)(!1))},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ne.PenAndPaper,{key:0,parent:e.unref(k),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(_),onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(ie)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:D,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),e.unref(t).style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:M,class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${e.unref(t).style.fontFamily}`)},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${e.unref(T)}`,config:{title:{cy:"history-plot-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"history-plot-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(y)&&(e.unref(j)||e.unref(L))?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_option_${e.unref(F)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(R),uid:e.unref(b),hasTooltip:e.unref(t).style.chart.tooltip.show&&e.unref(t).userOptions.buttons.tooltip,hasPdf:e.unref(t).userOptions.buttons.pdf,hasImg:e.unref(t).userOptions.buttons.img,hasXls:e.unref(t).userOptions.buttons.csv,hasTable:e.unref(t).userOptions.buttons.table,hasLabel:!1,hasFullscreen:e.unref(t).userOptions.buttons.fullscreen,isFullscreen:e.unref(w),chartElement:e.unref(k),position:e.unref(t).userOptions.position,isTooltip:e.unref(x).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(_),onToggleFullscreen:ve,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(W),onToggleTable:Q,onToggleTooltip:ee,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(j)?e.unref(L)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:u})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:r,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:r,isAnnotator:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${e.unref(f).width<0?.1:e.unref(f).width} ${e.unref(f).height<0?.1:e.unref(f).height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(be._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:e.unref(s).left,y:e.unref(s).top,width:e.unref(s).width<=0?10:e.unref(s).width,height:e.unref(s).height<=0?10:e.unref(s).height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Te)):e.createCommentVNode("",!0),e.unref(t).style.chart.plots.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(r,u)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${u}_${e.unref(b)}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(n.lightenHexColor)(r.color,e.unref(t).style.chart.plots.gradient.intensity/100)},null,8,Ve),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(n.darkenHexColor)(r.color,.1)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":r.color},null,8,De)],8,Pe))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.verticalLines.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).tickX,r=>(e.openBlock(),e.createElementBlock("line",{x1:r.x,x2:r.x,y1:r.y1,y2:r.y2,stroke:e.unref(t).style.chart.grid.verticalLines.stroke,"stroke-width":e.unref(t).style.chart.grid.verticalLines.strokeWidth,"stroke-linecap":"round"},null,8,Ie))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.axes.y.labels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).tickY,r=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(s).left+e.unref(t).style.chart.axes.y.labels.offsetX-4,y:r.y+e.unref(i).yAxisLabels/3,fill:e.unref(t).style.chart.axes.y.labels.color,"font-size":e.unref(i).yAxisLabels,"text-anchor":"end"},e.toDisplayString(e.unref(n.applyDataLabel)(e.unref(t).style.chart.axes.y.labels.formatter,r.value,e.unref(n.dataLabel)({p:e.unref(t).style.chart.axes.y.labels.prefix,v:r.value,s:e.unref(t).style.chart.axes.y.labels.suffix,r:e.unref(t).style.chart.axes.y.labels.rounding}))),9,Ye))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.axes.y.name.text?(e.openBlock(),e.createElementBlock("text",{key:4,transform:`translate(${e.unref(t).style.chart.axes.y.name.offsetX+e.unref(i).yAxisName}, ${e.unref(f).height/2+e.unref(t).style.chart.axes.y.name.offsetY}), rotate(-90)`,"font-size":e.unref(i).yAxisName,fill:e.unref(t).style.chart.axes.y.name.color,"font-weight":e.unref(t).style.chart.axes.y.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(t).style.chart.axes.y.name.text),9,qe)):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.horizontalLines.show?(e.openBlock(),e.createElementBlock("g",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).tickY,r=>(e.openBlock(),e.createElementBlock("line",{x1:r.x1,x2:r.x2,y1:r.y,y2:r.y,stroke:e.unref(t).style.chart.grid.horizontalLines.stroke,"stroke-width":e.unref(t).style.chart.grid.horizontalLines.strokeWidth,"stroke-linecap":"round"},null,8,Ue))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.axes.x.labels.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).tickX,r=>(e.openBlock(),e.createElementBlock("text",{transform:`translate(${r.x}, ${e.unref(s).bottom+e.unref(t).style.chart.axes.x.labels.offsetY+e.unref(i).xAxisLabels}), rotate(${e.unref(t).style.chart.axes.x.labels.rotation})`,fill:e.unref(t).style.chart.axes.x.labels.color,"font-size":e.unref(i).xAxisLabels,"text-anchor":e.unref(t).style.chart.axes.x.labels.rotation>0?"start":e.unref(t).style.chart.axes.x.labels.rotation<0?"end":"middle"},e.toDisplayString(e.unref(n.applyDataLabel)(e.unref(t).style.chart.axes.x.labels.formatter,r.value,e.unref(n.dataLabel)({p:e.unref(t).style.chart.axes.x.labels.prefix,v:r.value,s:e.unref(t).style.chart.axes.x.labels.suffix,r:e.unref(t).style.chart.axes.x.labels.rounding}))),9,He))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.axes.x.name.text?(e.openBlock(),e.createElementBlock("text",{key:7,x:e.unref(f).width/2+e.unref(t).style.chart.axes.x.name.offsetX,y:e.unref(f).height+e.unref(t).style.chart.axes.x.name.offsetY,"font-size":e.unref(i).xAxisName,fill:e.unref(t).style.chart.axes.x.name.color,"font-weight":e.unref(t).style.chart.axes.x.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(t).style.chart.axes.x.name.text),9,We)):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.xAxis.show?(e.openBlock(),e.createElementBlock("line",{key:8,x1:e.unref(s).left,x2:e.unref(s).left+e.unref(s).width,y1:e.unref(s).bottom,y2:e.unref(s).bottom,stroke:e.unref(t).style.chart.grid.xAxis.stroke,"stroke-width":e.unref(t).style.chart.grid.xAxis.strokeWidth,"stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0),e.unref(t).style.chart.grid.yAxis.show?(e.openBlock(),e.createElementBlock("line",{key:9,x1:e.unref(s).left,x2:e.unref(s).left,y1:e.unref(s).top,y2:e.unref(s).bottom,stroke:e.unref(t).style.chart.grid.yAxis.stroke,"stroke-width":e.unref(t).style.chart.grid.yAxis.strokeWidth,"stroke-linecap":"round"},null,8,Ze)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(r,u)=>(e.openBlock(),e.createElementBlock("g",null,[e.unref(t).style.chart.paths.show?(e.openBlock(),e.createElementBlock("g",{key:0,style:e.normalizeStyle({opacity:e.unref(m)===null?1:.3})},[e.createElementVNode("path",{d:r.path,stroke:e.unref(t).style.chart.backgroundColor,"stroke-width":e.unref(t).style.chart.paths.strokeWidth+4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:e.unref(t).useCssAnimation})},null,10,Je),e.createElementVNode("path",{d:r.path,stroke:e.unref(t).style.chart.paths.useSerieColor?r.color:e.unref(t).style.chart.paths.stroke,"stroke-width":e.unref(t).style.chart.paths.strokeWidth,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:e.unref(t).useCssAnimation})},null,10,Ke)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.plots,a=>(e.openBlock(),e.createElementBlock("circle",{cx:a.x,cy:a.y,fill:e.unref(t).style.chart.backgroundColor,r:e.unref(i).plots,stroke:"none"},null,8,Qe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.plots,a=>(e.openBlock(),e.createElementBlock("circle",{cx:a.x,cy:a.y,fill:e.unref(t).style.chart.plots.gradient.show?`url(#gradient_${u}_${e.unref(b)})`:a.color,r:e.unref(i).plots,stroke:e.unref(t).style.chart.plots.stroke,"stroke-width":e.unref(t).style.chart.plots.strokeWidth,class:e.normalizeClass({animated:e.unref(t).useCssAnimation}),style:e.normalizeStyle({opacity:e.unref(m)===null||e.unref(m).id===a.id?1:.3,transition:"opacity 0.2s ease-in-out"})},null,14,et))),256)),e.unref(t).style.chart.plots.labels.show?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.plots,a=>(e.openBlock(),e.createElementBlock("text",{x:a.x+e.unref(t).style.chart.plots.labels.offsetX,y:a.y+e.unref(t).style.chart.plots.labels.offsetY+e.unref(i).plots+e.unref(i).labels,"font-size":e.unref(i).labels,fill:e.unref(t).style.chart.plots.labels.color,"font-weight":e.unref(t).style.chart.plots.labels.bold?"bold":"normal","text-anchor":"middle",class:e.normalizeClass({animated:e.unref(t).useCssAnimation}),style:e.normalizeStyle({opacity:e.unref(m)===null||e.unref(m).id===a.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(a.label),15,lt))),256))])):e.createCommentVNode("",!0),e.unref(t).style.chart.plots.indexLabels.show?(e.openBlock(),e.createElementBlock("g",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.plots,(a,p)=>(e.openBlock(),e.createElementBlock("text",{x:a.x+e.unref(t).style.chart.plots.indexLabels.offsetX,y:a.y+e.unref(t).style.chart.plots.indexLabels.offsetY+e.unref(i).indexLabels/3,"font-size":e.unref(i).indexLabels,"font-weight":e.unref(t).style.chart.plots.indexLabels.bold?"bold":"normal",fill:e.unref(t).style.chart.plots.indexLabels.adaptColorToBackground?e.unref(n.adaptColorToBackground)(r.color):e.unref(t).style.chart.plots.indexLabels.color,"text-anchor":"middle",class:e.normalizeClass({animated:e.unref(t).useCssAnimation}),style:e.normalizeStyle({opacity:e.unref(m)===null||e.unref(m).id===a.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(e.unref(t).style.chart.plots.indexLabels.startAtZero?p:p+1),15,ot))),256))])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),r=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.plots,(u,a)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:"transparent",r:e.unref(i).plots,stroke:"none",onMouseenter:p=>ge({datapoint:u,plotIndex:a,seriesIndex:r.seriesIndex}),onMouseleave:o[0]||(o[0]=p=>{N.value=!1,m.value=null}),onClick:()=>xe(u)},null,40,at))),256))]))),256)),e.renderSlot(l.$slots,"svg",{svg:e.unref(f)},void 0,!0)],12,Me)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(y)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ze.default,{key:6,config:{type:"historyPlot",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,historyPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:A},[e.unref(t).style.chart.legend.show&&e.unref(y)?(e.openBlock(),e.createBlock(Ce.Legend,{key:`legend_${e.unref(P)}`,legendSet:e.unref(Z),config:e.unref(me),onClickMarker:o[1]||(o[1]=({legend:r})=>{G(r.seriesIndex),J(r)})},{item:e.withCtx(({legend:r,index:u})=>[e.createElementVNode("div",{onClick:a=>{r.segregate(),J(r)},style:e.normalizeStyle(`opacity:${e.unref(h).includes(r.seriesIndex)?.5:1}`)},e.toDisplayString(r.name),13,st)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:e.unref(Z)},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:O,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(we._sfc_main,{show:e.unref(x).showTooltip&&e.unref(N),backgroundColor:e.unref(t).style.chart.tooltip.backgroundColor,color:e.unref(t).style.chart.tooltip.color,fontSize:e.unref(t).style.chart.tooltip.fontSize,borderRadius:e.unref(t).style.chart.tooltip.borderRadius,borderColor:e.unref(t).style.chart.tooltip.borderColor,borderWidth:e.unref(t).style.chart.tooltip.borderWidth,backgroundOpacity:e.unref(t).style.chart.tooltip.backgroundOpacity,position:e.unref(t).style.chart.tooltip.position,offsetY:e.unref(t).style.chart.tooltip.offsetY,parent:e.unref(k),content:e.unref(z),isCustom:e.unref(C),isFullscreen:e.unref(w)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref($)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref($)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","isFullscreen"]),e.unref(y)?(e.openBlock(),e.createBlock(_e.default,{key:8,hideDetails:"",config:{open:e.unref(x).showTable,maxHeight:1e4,body:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color},head:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Se.DataTable,{key:`table_${e.unref(V)}`,colNames:e.unref(S).colNames,head:e.unref(S).head,body:e.unref(S).body,config:e.unref(S).config,title:`${e.unref(t).style.chart.title.text}${e.unref(t).style.chart.title.subtitle.text?` : ${e.unref(t).style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=r=>e.unref(x).showTable=!1)},{th:e.withCtx(({th:r})=>[e.createElementVNode("div",{innerHTML:r,style:{display:"flex","align-items":"center"}},null,8,it)]),td:e.withCtx(({td:r})=>[e.createTextVNode(e.toDisplayString(r.name||r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ee))}},ct=$e._export_sfc(ut,[["__scopeId","data-v-56886710"]]);exports.default=ct;
;