vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
10 lines (9 loc) • 45.1 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-_gyicZFE.cjs"),p=require("./useResponsive-N8jl0-aC.cjs"),vt=require("./Tooltip-C06-4zGf.cjs"),dt=require("./Legend-tU5gqFrZ.cjs"),ht=require("./Title-CsERtJKI.cjs"),ft=require("./Slicer-9-SDSvre.cjs"),Ye=require("./usePrinter-BRTNfg7r.cjs"),yt=require("./vue-ui-accordion-8mzPx86h.cjs"),pt=require("./DataTable-DL8_xKlk.cjs"),gt=require("./vue-ui-skeleton-KlT3Rmkn.cjs"),He=require("./useNestedProp-BJQoarHp.cjs"),me=require("./BaseIcon-q0bEOOzl.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),mt=require("./PenAndPaper.vue_vue_type_style_index_0_scoped_3cea7589_lang-B-psJjxF.cjs"),bt=require("./useUserOptionState-BgepsfED.cjs"),xt=require("./useChartAccessibility-Cm7nkzTG.cjs"),kt={class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0}),style:{padding:"0 !important"}},Lt=["disabled"],Ct=["xmlns","viewBox"],wt=["cx","cy","r","fill"],St=["d","stroke","stroke-width"],$t=["d","stroke","stroke-width"],zt={__name:"NonSvgPenAndPaper",props:{parent:{type:HTMLElement},backgroundColor:{type:String,default:"#FFFFFF"},color:{type:String,default:"#2D353C"},active:{type:Boolean,default:!1}},emits:["close"],setup($,{emit:be}){const X=$,xe=be,x=l.ref([]),D=l.ref([]),_=l.ref("0 0 0 0"),V=l.ref(X.color),c=l.ref(1),k=l.computed(()=>u.lightenHexColor(X.color,.6));function F({width:h,height:v}){_.value=`0 0 ${h} ${v}`}const U=l.ref(null);l.onMounted(()=>{l.nextTick(()=>{if(X.parent){U.value=new ResizeObserver(s=>{for(const d of s){const{width:g,height:C}=d.contentRect;F({width:g,height:C})}}),U.value.observe(X.parent);const{width:h,height:v}=X.parent.getBoundingClientRect();F({width:h,height:v})}})}),l.onBeforeUnmount(()=>{U.value&&U.value.disconnect()}),l.watch(()=>X.parent,h=>{if(!h)return;const{width:v,height:s}=X.parent.getBoundingClientRect();F({width:v,height:s})},{immediate:!0});const f=l.ref(!1),A=l.ref(""),Z=l.ref(null);function I(h){if(!Z.value)return;f.value=!0;const{x:v,y:s}=re(h);A.value=`M ${v} ${s}`}function q(h){if(!f.value||!Z.value)return;const{x:v,y:s}=re(h);A.value+=` ${v} ${s}`}function Y(h){const v=h.trim().split(/\s+/);if(v.length<4)return h;const s=v.slice(1).map(Number);if(s.length%2!==0)return h;const d=G(s),g=[`M ${d[0]} ${d[1]}`];for(let E=2;E<d.length-2;E+=2){const t=d[E-2],M=d[E-1],P=d[E],T=d[E+1],B=(t+P)/2,j=(M+T)/2;g.push(`Q ${t} ${M} ${B} ${j}`)}const C=d[d.length-2],S=d[d.length-1];return g.push(`L ${C} ${S}`),g.join(" ")}function G(h,v=1){const s=[...h];for(let d=2;d<h.length-2;d+=2){const g=h[d],C=h[d+1],S=h[d-2],E=h[d-1],t=h[d+2],M=h[d+3];s[d]=g+v*((S+t)/2-g),s[d+1]=C+v*((E+M)/2-C)}return s}function oe(h){const v=h.trim().split(/\s+/);let s="",d="",g=null,C=null;for(let S=0;S<v.length;S+=1){const E=v[S];if(isNaN(E)){if(d=E,d==="M"||d==="L")g=parseFloat(v[++S]),C=parseFloat(v[++S]),s+=`${d}${g} ${C}`;else if(d==="Q"){const t=parseFloat(v[++S]),M=parseFloat(v[++S]),P=parseFloat(v[++S]),T=parseFloat(v[++S]);t===g&&M===C?s+=`t${P-g} ${T-C}`:s+=`q${t-g} ${M-C} ${P-g} ${T-C}`,g=P,C=T}}else{const t=parseFloat(E),M=parseFloat(v[++S]);if(d==="L"){const P=t-g,T=M-C;P===0?s+=`v${T}`:T===0?s+=`h${P}`:s+=`l${P} ${T}`,g=t,C=M}else if(d==="Q"){const P=t,T=M,B=parseFloat(v[++S]),j=parseFloat(v[++S]);P===g&&T===C?s+=`t${B-g} ${j-C}`:s+=`q${P-g} ${T-C} ${B-g} ${j-C}`,g=B,C=j}}}return s}function ee(){f.value&&(x.value.push({strokeWidth:c.value,path:oe(Y(A.value)),color:V.value}),D.value=[],A.value=""),f.value=!1}function re(h){if(!Z.value)return{x:0,y:0};const v=Z.value.getBoundingClientRect();let s,d;return h.touches&&h.touches.length?(s=h.touches[0].clientX,d=h.touches[0].clientY):(s=h.clientX,d=h.clientY),{x:s-v.left,y:d-v.top}}l.ref(!1);function te(){if(x.value.length>0){const h=x.value.pop();D.value.push(h)}}function ce(){if(D.value.length>0){const h=D.value.pop();x.value.push(h)}}function ve(){x.value=[],D.value=[]}const de=l.ref(null);return(h,v)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[$.active?(l.openBlock(),l.createElementBlock("div",{key:0,"data-html2canvas-ignore":"",class:l.normalizeClass({"vue-ui-pen-and-paper-actions":!0,visible:$.active})},[l.createElementVNode("button",{class:"vue-ui-pen-and-paper-action",style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:v[0]||(v[0]=s=>xe("close"))},[l.createVNode(me.default,{name:"close",stroke:$.color},null,8,["stroke"])],4),l.createElementVNode("button",kt,[l.createVNode(mt.ColorPicker,{value:V.value,"onUpdate:value":v[1]||(v[1]=s=>V.value=s),backgroundColor:$.backgroundColor,buttonBorderColor:k.value},null,8,["value","backgroundColor","buttonBorderColor"])]),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length}),disabled:!x.value.length,style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:te},[l.createVNode(me.default,{name:"restart",stroke:$.color},null,8,["stroke"])],14,Lt),l.createElementVNode("button",{class:l.normalizeClass({"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!D.value.length}),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ce},[l.createVNode(me.default,{name:"restart",stroke:$.color,style:{transform:"scaleX(-1)"}},null,8,["stroke"])],6),l.createElementVNode("button",{class:l.normalizeClass([{"vue-ui-pen-and-paper-action":!0,"vue-ui-pen-and-paper-action-disabled":!x.value.length},"vue-ui-pen-and-paper-action"]),style:l.normalizeStyle({backgroundColor:$.backgroundColor,border:`1px solid ${k.value}`}),onClick:ve},[l.createVNode(me.default,{name:"trash",stroke:$.color},null,8,["stroke"])],6),l.withDirectives(l.createElementVNode("input",{ref_key:"range",ref:de,type:"range",class:"vertical-range",min:.5,max:12,step:.1,"onUpdate:modelValue":v[2]||(v[2]=s=>c.value=s),style:l.normalizeStyle({accentColor:$.color})},null,4),[[l.vModelText,c.value]])],2)):l.createCommentVNode("",!0),(l.openBlock(),l.createElementBlock("svg",{ref_key:"svgElement",ref:Z,xmlns:l.unref(u.XMLNS),viewBox:_.value,class:l.normalizeClass({"vue-ui-pen-and-paper":!0,inactive:!$.active}),onMousedown:I,onMousemove:q,onMouseup:ee,onMouseleave:ee,onTouchstart:l.withModifiers(I,["prevent"]),onTouchmove:l.withModifiers(q,["prevent"]),onTouchend:ee},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,s=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s},[s.path.replace("M","").split(" ").length===2?(l.openBlock(),l.createElementBlock("circle",{key:0,cx:s.path.replace("M","").split(" ")[0],cy:s.path.replace("M","").split(" ")[1],r:s.strokeWidth/2,fill:s.color},null,8,wt)):(l.openBlock(),l.createElementBlock("path",{key:1,class:"vue-ui-pen-and-paper-path",d:s.path,stroke:s.color,"stroke-width":s.strokeWidth,fill:"none"},null,8,St))],64))),128)),f.value?(l.openBlock(),l.createElementBlock("path",{key:0,class:"vue-ui-pen-and-paper-path vue-ui-pen-and-paper-path-drawing",d:Y(A.value),stroke:V.value,"stroke-width":c.value*1.1,fill:"none"},null,8,$t)):l.createCommentVNode("",!0)],42,Ct))],64))}},Mt=Xe._export_sfc(zt,[["__scopeId","data-v-1ffe1d80"]]),Pt=["id"],Tt=["onClick"],Bt={key:2,class:"vue-data-ui-watermark"},It=["innerHTML"],Et={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup($,{expose:be,emit:X}){const{vue_ui_xy_canvas:xe}=u.useConfig(),x=$,D=l.ref(u.createUid()),_=l.ref(null),V=l.ref(null),c=l.ref(null),k=l.ref(1),F=l.ref(1),U=l.ref(!1),f=l.ref(null),A=l.ref(""),Z=l.ref(null),I=l.ref([]),q=l.ref(1),Y=l.ref(!0),G=l.ref(!0),oe=l.ref(null),ee=l.ref(0),re=l.ref(0),te=l.ref(!1),ce=l.ref(null),ve=l.ref(null),de=l.ref(null),h=l.ref(null),v=l.ref(0),s=l.ref(0),d=l.ref(0),g=l.ref(null),C=l.computed(()=>!!x.dataset&&x.dataset.length),S=X,E=l.useSlots();l.onMounted(()=>{E["chart-background"]&&console.warn("VueUiXyCanvas does not support the #chart-background slot.")});const t=l.computed({get:()=>j(),set:e=>e}),{userOptionsVisible:M,setUserOptionsVisibility:P,keepUserOptionState:T}=bt.useUserOptionState({config:t.value}),{svgRef:B}=xt.useChartAccessibility({config:t.value.style.chart.title});function j(){const e=He.useNestedProp({userConfig:x.config,defaultConfig:xe});let o={};return e.theme?o={...He.useNestedProp({userConfig:u.themes.vue_ui_xy_canvas[e.theme]||x.config,defaultConfig:e}),customPalette:u.themePalettes[e.theme]||u.palette}:o=e,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.min")?o.style.chart.scale.min=x.config.style.chart.scale.min:o.style.chart.scale.min=null,x.config&&u.hasDeepProperty(x.config,"style.chart.scale.max")?o.style.chart.scale.max=x.config.style.chart.scale.max:o.style.chart.scale.max=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.startIndex")?o.style.chart.zoom.startIndex=x.config.style.chart.zoom.startIndex:o.style.chart.zoom.startIndex=null,x.config&&u.hasDeepProperty(x.config,"style.chart.zoom.endIndex")?o.style.chart.zoom.endIndex=x.config.style.chart.zoom.endIndex:o.style.chart.zoom.endIndex=null,o}l.watch(()=>x.config,e=>{t.value=j(),M.value=!t.value.userOptions.showOnChartHover,ke(),v.value+=1,s.value+=1,d.value+=1,i.value.showTable=t.value.table.show,i.value.showDataLabels=t.value.style.chart.dataLabels.show,i.value.stacked=t.value.style.chart.stacked,i.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),l.watch(()=>x.dataset,()=>{ke(),v.value+=1,s.value+=1,d.value+=1},{deep:!0});const Ce=l.ref(t.value.style.chart.aspectRatio),{isPrinting:we,isImaging:Se,generatePdf:$e,generateImage:ze}=Ye.usePrinter({elementId:`xy_canvas_${D.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),i=l.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Ue(e){te.value=e,re.value+=1}const Me=l.computed(()=>u.convertCustomPalette(t.value.customPalette)),H=l.computed(()=>le.value?Math.max(...le.value.filter((e,o)=>!I.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),a=l.computed(()=>{const e=k.value-k.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:k.value,canvasHeight:F.value,left:k.value*t.value.style.chart.paddingProportions.left,top:F.value*t.value.style.chart.paddingProportions.top,right:k.value-k.value*t.value.style.chart.paddingProportions.right,bottom:F.value-F.value*t.value.style.chart.paddingProportions.bottom,width:e,height:F.value-F.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(n.value.end-n.value.start)}});function Pe(e,o){return e/o}function qe({hasAutoScale:e,series:o,min:r,max:y,scale:b,yOffset:R,individualHeight:m,stackIndex:w=null}){return o.map((J,O)=>{const Q=b.min<0?Math.abs(b.min):0,K=Pe(J+Q,Q+b.max);let se,ie;e&&(se=b.min,ie=Pe(J-se,b.max-se));let W=0;return w===null?W=a.value.bottom-a.value.height*(e?ie:K):W=a.value.bottom-R-m*(e?ie:K),{x:a.value.left+a.value.slot*O+a.value.slot/2,y:W,value:J}})}const z=l.computed(()=>{const e=t.value.style.chart.scale.min!==null?t.value.style.chart.scale.min:Math.min(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),o=t.value.style.chart.scale.max!==null?t.value.style.chart.scale.max:Math.max(...le.value.filter((m,w)=>!I.value.includes(m.absoluteIndex)).flatMap(m=>m.series.slice(n.value.start,n.value.end))),r=u.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),y=r.min<0?Math.abs(r.min):0,b=a.value.bottom-a.value.height*(y/(r.max+y)),R=r.ticks.map(m=>({y:a.value.bottom-a.value.height*((m+y)/(r.max+y)),x:a.value.left-8,value:m}));return{absoluteMin:y,max:o,min:e,scale:r,yLabels:R,zero:b}}),We=l.computed(()=>L.value.map(e=>`
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
<svg viewBox="0 0 10 10" height="12" width="12">
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
</svg>
<span>${e.name?e.name+": ":""}</span>
<span>${u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[f.value],u.dataLabel({p:e.prefix||"",v:e.series[f.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:f.value})}</span>
</div>
`)),le=l.computed(()=>x.dataset.map((e,o)=>({...e,series:u.largestTriangleThreeBucketsArray({data:u.sanitizeArray(e.series),threshold:t.value.downsample.threshold}),absoluteIndex:o,color:u.convertColorToHex(e.color||Me.value[o]||u.palette[o]||u.palette[o%u.palette.length])})));l.watch(H,e=>{e&&Te()});const L=l.computed(()=>u.assignStackRatios(le.value.filter((e,o)=>!I.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(n.value.start,n.value.end)})).map((e,o)=>{let r=[null,void 0].includes(e.scaleMin)?Math.min(...e.series)||0:e.scaleMin,y=[null,void 0].includes(e.scaleMax)?Math.max(...e.series)||1:e.scaleMax;r===y&&(r=r>=0?y-1:r,y=y>=0?y:r+1),e.series.filter(W=>![null,void 0].includes(W)).map(W=>(W-r)/(y-r));const b={valueMin:r,valueMax:y},R=e.scaleSteps||t.value.style.chart.scale.ticks;let m;e.autoScaling?m=u.calculateNiceScale(b.valueMin,b.valueMax,R):m=u.calculateNiceScale(b.valueMin<0?b.valueMin:0,b.valueMax<=0?0:b.valueMax,R);const w=i.value.stacked?a.value.height*(1-e.cumulatedStackRatio):0,J=i.value.stacked?a.value.height/t.value.style.chart.stackGap:0,O=i.value.stacked?a.value.height*e.stackRatio-J:a.value.height,Q=m.min<0?Math.abs(m.min):0;let K;e.autoScaling&&i.value.stacked&&y<=0?K=a.value.bottom-w-O:K=a.value.bottom-w-O*(Q/(m.max+Q));const se=m.ticks.map((W,ct)=>({y:a.value.bottom-w-O*(ct/(m.ticks.length-1)),x:a.value.left-8,value:W})),ie=qe({hasAutoScale:i.value.stacked&&e.autoScaling,series:e.series,min:i.value.stacked?r:z.value.min,max:i.value.stacked?y:z.value.max,scale:i.value.stacked?m:z.value.scale,yOffset:w,individualHeight:O,stackIndex:i.value.stacked?o:null});return{...e,coordinatesLine:ie,min:r,max:y,localScale:m,localZero:K,localMin:Q,localYLabels:se,yOffset:w,individualHeight:O}})),n=l.ref({start:0,end:H.value});function Te(){Be()}const ae=l.ref(null);async function Be(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&ae.value?(t.value.style.chart.zoom.startIndex!==null&&(await l.nextTick(),await l.nextTick(),ae.value&&ae.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await l.nextTick(),await l.nextTick(),ae.value&&ae.value.setEndValue(_e(t.value.style.chart.zoom.endIndex+1)))):(n.value={start:0,end:H.value},ee.value+=1)}function _e(e){const o=H.value;return e>o?o:e<0||t.value.style.chart.zoom.startIndex!==null&&e<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:e}const Ze=l.computed(()=>L.value.filter(e=>["line","plot",void 0].includes(e.type))),N=l.computed(()=>L.value.filter(e=>e.type==="bar"));function Ge(){if(!B.value)return;const e=V.value.offsetWidth,o=V.value.offsetHeight;B.value.width=e*q.value*2,B.value.height=o*q.value*2,k.value=e*q.value*2,F.value=o*q.value*2,c.value.scale(q.value,q.value),ne()}function je(){if(c.value.clearRect(0,0,1e4,1e4),c.value.fillStyle=t.value.style.chart.backgroundColor,c.value.fillRect(0,0,a.value.canvasWidth,a.value.canvasHeight),i.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength?L.value.forEach(e=>{for(let o=0;o<n.value.end-n.value.start+1;o+=1)p.line(c.value,[{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*o,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}):t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&L.value.forEach(e=>{for(let o=n.value.start;o<n.value.end;o+=1)o%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&p.line(c.value,[{x:a.value.left+a.value.slot*(o-n.value.start)+a.value.slot/2,y:a.value.bottom-e.yOffset-e.individualHeight},{x:a.value.left+a.value.slot*(o-n.value.start)+a.value.slot/2,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?L.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{r<e.localYLabels.length-1&&p.rect(c.value,[{x:a.value.left,y:o.y},{x:a.value.right,y:o.y},{x:a.value.right,y:e.localYLabels[r+1].y},{x:a.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})})}):L.value.forEach(e=>{e.localYLabels.slice(n.value.start,n.value.end).forEach(o=>{p.line(c.value,[{x:a.value.left,y:o.y},{x:a.value.right,y:o.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&L.value.forEach(e=>{p.line(c.value,[{x:a.value.left,y:e.localZero},{x:a.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&L.value.forEach(e=>{p.line(c.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.left,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),p.line(c.value,[{x:a.value.right,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset-e.individualHeight}],{color:e.color})}),L.value.forEach(e=>{p.text(c.value,e.name,k.value/35,a.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<n.value.end-n.value.start+1;e+=1)p.line(c.value,[{x:a.value.left+a.value.slot*e,y:a.value.top},{x:a.value.left+a.value.slot*e,y:a.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});else if(t.value.style.chart.grid.y.verticalLines.show&&n.value.end-n.value.start>=t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=n.value.start;e<n.value.end;e+=1)e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0&&p.line(c.value,[{x:a.value.left+a.value.slot*(e-n.value.start)+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*(e-n.value.start)+a.value.slot/2,y:a.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?z.value.yLabels.forEach((e,o)=>{o<z.value.yLabels.length-1&&p.rect(c.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y},{x:a.value.right,y:z.value.yLabels[o+1].y},{x:a.value.left,y:z.value.yLabels[o+1].y}],{fillColor:o%2===0?"transparent":u.setOpacity(t.value.style.chart.grid.x.horizontalLines.color,t.value.style.chart.grid.x.horizontalLines.opacity),strokeColor:"transparent"})}):z.value.yLabels.forEach(e=>{p.line(c.value,[{x:a.value.left,y:e.y},{x:a.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&p.line(c.value,[{x:a.value.left,y:a.value.top},{x:a.value.left,y:a.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&p.line(c.value,[{x:a.value.left,y:a.value.bottom},{x:a.value.right,y:a.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&p.line(c.value,[{x:a.value.left,y:z.value.zero},{x:a.value.right,y:z.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}t.value.style.chart.grid.y.axisName&&p.text(c.value,t.value.style.chart.grid.y.axisName,k.value-k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,a.value.bottom-a.value.height/2,{font:`${t.value.style.chart.grid.y.axisLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&p.text(c.value,t.value.style.chart.grid.x.axisName,k.value/2,F.value,{font:`${t.value.style.chart.grid.y.axisLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Qe(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(f.value===o?k.value/150:t.value.style.chart.line.plots.show?k.value/200:0)*t.value.style.chart.line.plots.radiusRatio;p.circle(c.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}}function Je(){L.value.forEach(e=>{e.showYMarker&&ue(e)&&p.text(c.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,ue(e).value,u.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:ue(e).value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:ue(e),seriesIndex:null}),a.value.left-8+t.value.style.chart.grid.y.axisLabels.offsetX,ue(e).y,{align:"right",font:`${t.value.style.chart.grid.y.axisLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}function Ke(){t.value.style.chart.grid.y.axisLabels.show&&(i.value.stacked?L.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{p.text(c.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,o.value,u.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:o.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:o,seriesIndex:r}),o.x+t.value.style.chart.grid.y.axisLabels.offsetX,o.y,{align:"right",font:`${t.value.style.chart.grid.y.axisLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color,globalAlpha:e.showYMarker&&![null,void 0].includes(f.value)?.2:1})})}):z.value.yLabels.forEach((e,o)=>{p.text(c.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,u.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:o}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${t.value.style.chart.grid.y.axisLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color,globalAlpha:L.value.some(r=>r.showYMarker)&&![null,void 0].includes(f.value)?.2:1})}))}function et(e){for(let o=0;o<e.coordinatesLine.length;o+=1)p.text(c.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[o].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[o].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[o],seriesIndex:o}),e.coordinatesLine[o].x,e.coordinatesLine[o].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${t.value.style.chart.dataLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color})}function tt(){for(let e=n.value.start;e<n.value.end;e+=1)(n.value.end-n.value.start<t.value.style.chart.grid.y.timeLabels.modulo||n.value.end-n.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((n.value.end-n.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===f.value+n.value.start&&t.value.style.chart.grid.y.timeLabels.showMarker))&&p.text(c.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,a.value.left+a.value.slot*(e-n.value.start)+a.value.slot/2,a.value.bottom+k.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${t.value.style.chart.grid.y.timeLabels.bold?"bold ":""}${Math.round(k.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.timeLabels.showMarker?u.setOpacity(t.value.style.chart.grid.y.timeLabels.color,f.value!==null?f.value+n.value.start===e?100:20:100):t.value.style.chart.grid.y.timeLabels.color,rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function Ie(){p.line(c.value,[{x:a.value.left+a.value.slot*f.value+a.value.slot/2,y:a.value.top},{x:a.value.left+a.value.slot*f.value+a.value.slot/2,y:a.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function lt(){g.value&&p.line(c.value,[{x:a.value.left,y:g.value},{x:a.value.right,y:g.value}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2})}function at(){N.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)p.rect(c.value,[{x:a.value.left+a.value.slot*r+a.value.slot/10+(i.value.stacked?0:a.value.slot/N.value.length*o-(o===0?0:a.value.slot/(5*N.value.length)*o)),y:i.value.stacked?e.localZero:z.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(i.value.stacked?0:a.value.slot/N.value.length*o-(o===0?0:a.value.slot/(5*N.value.length)*o))+a.value.slot*.8/(i.value.stacked?1:N.value.length),y:i.value.stacked?e.localZero:z.value.zero},{x:a.value.left+a.value.slot*r+a.value.slot/10+(i.value.stacked?0:a.value.slot/N.value.length*o-(o===0?0:a.value.slot/(5*N.value.length)*o))+a.value.slot*.8/(i.value.stacked?1:N.value.length),y:e.coordinatesLine[r].y},{x:a.value.left+a.value.slot*r+a.value.slot/10+(i.value.stacked?0:a.value.slot/N.value.length*o-(o===0?0:a.value.slot/(5*N.value.length)*o)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:i.value.stacked?e.localZero:z.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:t.value.style.chart.bar.gradient.show?u.lightenHexColor(e.color,.5):e.color}]}}),i.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&p.text(c.value,u.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,u.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),a.value.left+a.value.slot*r+a.value.slot/10+(i.value.stacked?0:a.value.slot/N.value.length*o-(o===0?0:a.value.slot/(5*N.value.length)*o))+a.value.slot*.4/(i.value.stacked?1:N.value.length),(e.coordinatesLine[r].value<0?i.value.stacked?e.localZero:z.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(k.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function ot(e){e.useArea?i.value.stacked?p.polygon(c.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):p.polygon(c.value,[{x:e.coordinatesLine[0].x,y:z.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:z.value.zero}],{fillColor:u.setOpacity(e.color,t.value.style.chart.area.opacity),strokeColor:"transparent"}):p.line(c.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function rt(){L.value.forEach((e,o)=>{p.line(c.value,[{x:a.value.left,y:a.value.bottom-e.yOffset},{x:a.value.right,y:a.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function ne(){je(),Y.value?(f.value!==null&&t.value.style.chart.selector.show&&Ie(),at(),i.value.stacked&&t.value.style.chart.grid.x.showAxis&&rt(),Ze.value.forEach(e=>{(e.type==="line"||!e.type)&&ot(e),G.value&&(Qe(e),i.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&et(e))}),oe.value=p.cloneCanvas(B.value)):(oe.value&&(c.value.clearRect(0,0,1e4,1e4),c.value.drawImage(oe.value,0,0)),f.value!==null&&t.value.style.chart.selector.show&&Ie(),f.value!==null&&L.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[f.value])return;e.coordinatesLine[f.value].x!==void 0&&e.coordinatesLine[f.value].y!==void 0&&p.circle(c.value,{x:e.coordinatesLine[f.value].x,y:e.coordinatesLine[f.value].y},k.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color})}})),t.value.style.chart.grid.y.timeLabels.show&&tt(),t.value.style.chart.selector.show&&t.value.style.chart.selector.showHorizontalSelector&<(),Ke(),Je(),Y.value=!1}const he=p.debounce(()=>{G.value=!0,Ge()},H.value>200?10:1,!G.value);function ue(e){if([null,void 0].includes(f.value)||!e.coordinatesLine[f.value])return!1;const{y:o,value:r}=e.coordinatesLine[f.value];return{y:o,value:r}}function nt(e){const{left:o,top:r}=B.value.getBoundingClientRect(),y=e.clientX-o;if(g.value=(e.clientY-r)*2,(g.value<a.value.top||g.value>a.value.bottom)&&(g.value=null),y*2<a.value.left||y*2>a.value.right){U.value=!1,f.value=null;return}const b=y*2-a.value.left;if(f.value=Math.floor(b/a.value.slot),U.value=!0,!G.value)return;let R="";const m=t.value.style.chart.tooltip.customFormat;u.isFunction(m)&&u.functionReturnsString(()=>m({seriesIndex:f.value,datapoint:L.value.map(w=>({shape:w.shape||null,name:w.name,color:w.color,type:w.type||"line",value:w.series.find((J,O)=>O===f.value)})),series:L.value,config:t.value}))?A.value=m({seriesIndex:f.value,datapoint:L.value.map(w=>({shape:w.shape||null,name:w.name,color:w.color,type:w.type||"line",value:w.series.find((J,O)=>O===f.value)})),series:L.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[f.value]&&(R+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[f.value]}</div>`),R+=We.value.join(""),A.value=R),G.value=!1}l.watch(()=>f.value,e=>{he()}),l.watch(()=>n.value,e=>{Y.value=!0,ne()},{deep:!0}),l.watch(()=>i.value.showDataLabels,e=>{Y.value=!0,ne()}),l.watch(()=>g.value,e=>{e&&ne()}),l.watch(()=>i.value.stacked,e=>{Y.value=!0,G.value=!0,he()});function ut(){U.value=!1,f.value=null,A.value="",g.value=null,ne()}const fe=l.ref(null),ye=l.ref(null);l.onMounted(()=>{ke()});function ke(){if(u.objectIsEmpty(x.dataset)?u.error({componentName:"VueUiXyCanvas",type:"dataset"}):B.value&&(c.value=B.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=p.throttle(()=>{const{width:o,height:r}=p.useResponsive({chart:_.value,title:t.value.style.chart.title.text?ce.value:null,legend:t.value.style.chart.legend.show?ve.value:null,slicer:t.value.style.chart.zoom.show&&H.value>1?de.value:null,source:h.value});requestAnimationFrame(()=>{Ce.value=`${o} / ${r}`})});fe.value=new ResizeObserver(e),fe.value.observe(_.value.parentNode)}ye.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&V.value&&(Y.value=!0,he())}),ye.value.observe(V.value),Be()}l.onBeforeUnmount(()=>{ye.value&&ye.value.disconnect(),fe.value&&fe.value.disconnect()});function Ee(e){S("selectLegend",L.value.find(o=>o.absoluteIndex===e)),I.value.includes(e)?I.value=I.value.filter(o=>o!==e):I.value.push(e),Y.value=!0,he()}const Ne=l.computed(()=>le.value.map((e,o)=>({...e,name:e.name,color:u.convertColorToHex(e.color)||Me.value[o]||u.palette[o]||u.palette[o%u.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:I.value.includes(e.absoluteIndex)?.5:1,segregate:()=>Ee(e.absoluteIndex),isSegregated:I.value.includes(e.absoluteIndex)}))),st=l.computed(()=>({cy:"donut-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":""})),pe=l.computed(()=>{const e=[""].concat(L.value.map(b=>b.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let o=[];for(let b=0;b<H.value;b+=1){const R=L.value.map(m=>m.series[b]??0).reduce((m,w)=>m+w,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(n.value.start,n.value.end)[b]??b+1].concat(L.value.map(m=>(m.series[b]??0).toFixed(t.value.table.rounding))).concat((R??0).toFixed(t.value.table.rounding)))}const 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},y=[t.value.table.columnNames.period].concat(L.value.map(b=>b.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,n.value.end-n.value.start),config:r,colNames:y}}),Re=l.computed(()=>{if(L.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=L.value.map(r=>({label:r.name,color:r.color,type:r.type})),o=[];for(let r=n.value.start;r<n.value.end;r+=1){const y=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];L.value.forEach(b=>{y.push(Number((b.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(y)}return{head:e,body:o}});function Fe(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...Re.value.head.map(R=>R.label)],r=Re.value.body,y=e.concat([o]).concat(r),b=u.createCsvContent(y);u.downloadCsv({csvContent:b,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function it(){return L.value}function Oe(){i.value.showTable=!i.value.showTable}function De(){i.value.showDataLabels=!i.value.showDataLabels}function Ve(){i.value.stacked=!i.value.stacked}function Ae(){i.value.showTooltip=!i.value.showTooltip}const ge=l.ref(!1);function Le(){ge.value=!ge.value}return be({getData:it,generateCsv:Fe,generatePdf:$e,generateImage:ze,toggleTable:Oe,toggleLabels:De,toggleStack:Ve,toggleTooltip:Ae,toggleAnnotator:Le}),(e,o)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(`width:100%; position:relative; ${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:_,id:`xy_canvas_${D.value}`,class:l.normalizeClass(`vue-ui-donut ${te.value?"vue-data-ui-wrapper-fullscreen":""}`),onMouseenter:o[5]||(o[5]=()=>l.unref(P)(!0)),onMouseleave:o[6]||(o[6]=()=>l.unref(P)(!1))},[t.value.style.chart.title.text?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:ce,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(l.openBlock(),l.createBlock(ht._sfc_main,{key:`title_${v.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):l.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(l.unref(T)||l.unref(M))?(l.openBlock(),l.createBlock(Ye.UserOptions,{ref:"details",key:`user_option_${re.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:l.unref(we),isImaging:l.unref(Se),uid:D.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasLabel:t.value.userOptions.buttons.labels,hasStack:$.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:n.value.end-n.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:te.value,isTooltip:i.value.showTooltip,isStacked:i.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:ge.value,onToggleFullscreen:Ue,onGeneratePdf:l.unref($e),onGenerateCsv:Fe,onGenerateImage:l.unref(ze),onToggleTable:Oe,onToggleLabels:De,onToggleStack:Ve,onToggleTooltip:Ae,onToggleAnnotator:Le,style:l.normalizeStyle({visibility:l.unref(T)?l.unref(M)?"visible":"hidden":"visible"})},l.createSlots({_:2},[e.$slots.menuIcon?{name:"menuIcon",fn:l.withCtx(({isOpen:r,color:y})=>[l.renderSlot(e.$slots,"menuIcon",l.normalizeProps(l.guardReactiveProps({isOpen:r,color:y})),void 0,!0)]),key:"0"}:void 0,e.$slots.optionTooltip?{name:"optionTooltip",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"7"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:l.withCtx(({toggleFullscreen:r,isFullscreen:y})=>[l.renderSlot(e.$slots,"optionFullscreen",l.normalizeProps(l.guardReactiveProps({toggleFullscreen:r,isFullscreen:y})),void 0,!0)]),key:"8"}:void 0,e.$slots.optionAnnotator?{name:"optionAnnotator",fn:l.withCtx(({toggleAnnotator:r,isAnnotator:y})=>[l.renderSlot(e.$slots,"optionAnnotator",l.normalizeProps(l.guardReactiveProps({toggleAnnotator:r,isAnnotator:y})),void 0,!0)]),key:"9"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"vue-ui-xy-canvas",style:l.normalizeStyle(`position: relative; aspect-ratio: ${Ce.value}`),ref_key:"container",ref:V},[C.value?(l.openBlock(),l.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:B,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>nt(r)),onMouseleave:ut},null,544)):(l.openBlock(),l.createBlock(gt.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),l.createVNode(vt._sfc_main,{show:i.value.showTooltip&&U.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:l.unref(B),content:A.value,isFullscreen:te.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:l.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-before",l.normalizeProps(l.guardReactiveProps({...Z.value})),void 0,!0)]),"tooltip-after":l.withCtx(()=>[l.renderSlot(e.$slots,"tooltip-after",l.normalizeProps(l.guardReactiveProps({...Z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","isFullscreen","backgroundOpacity","isCustom"])],4),l.createElementVNode("div",{ref_key:"chartSlicer",ref:de,style:l.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&H.value>1?(l.openBlock(),l.createBlock(ft.Slicer,{ref_key:"slicerComponent",ref:ae,key:`slicer_${ee.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.y.timeLabels.values[n.value.start]?t.value.style.chart.grid.y.timeLabels.values[n.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[n.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:H.value,min:0,valueStart:n.value.start,valueEnd:n.value.end,start:n.value.start,"onUpdate:start":o[1]||(o[1]=r=>n.value.start=r),end:n.value.end,"onUpdate:end":o[2]||(o[2]=r=>n.value.end=r),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:H.value,enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:Te},{"reset-action":l.withCtx(({reset:r})=>[l.renderSlot(e.$slots,"reset-action",l.normalizeProps(l.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):l.createCommentVNode("",!0)],4),l.createElementVNode("div",{ref_key:"chartLegend",ref:ve},[t.value.style.chart.legend.show&&C.value?(l.openBlock(),l.createBlock(dt.Legend,{legendSet:Ne.value,config:st.value,key:`legend_${d.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>Ee(r))},{item:l.withCtx(({legend:r,index:y})=>[l.createElementVNode("div",{onClick:b=>r.segregate(),style:l.normalizeStyle(`opacity:${I.value.includes(y)?.5:1}`)},l.toDisplayString(r.name),13,Tt)]),_:1},8,["legendSet","config"])):l.renderSlot(e.$slots,"legend",{key:1,legend:Ne.value},void 0,!0)],512),e.$slots.watermark?(l.openBlock(),l.createElementBlock("div",Bt,[l.renderSlot(e.$slots,"watermark",l.normalizeProps(l.guardReactiveProps({isPrinting:l.unref(we)||l.unref(Se)})),void 0,!0)])):l.createCommentVNode("",!0),e.$slots.source?(l.openBlock(),l.createElementBlock("div",{key:3,ref_key:"source",ref:h,dir:"auto"},[l.renderSlot(e.$slots,"source",{},void 0,!0)],512)):l.createCommentVNode("",!0),n.value.end-n.value.start<200?(l.openBlock(),l.createBlock(yt.default,{key:4,hideDetails:"",config:{open:i.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:l.withCtx(()=>[(l.openBlock(),l.createBlock(pt.DataTable,{key:`table_${s.value}`,colNames:pe.value.colNames,head:pe.value.head,body:pe.value.body,config:pe.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[4]||(o[4]=r=>i.value.showTable=!1)},{th:l.withCtx(({th:r})=>[l.createElementVNode("div",{innerHTML:r},null,8,It)]),td:l.withCtx(({td:r})=>[l.createTextVNode(l.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):l.createCommentVNode("",!0),t.value.userOptions.buttons.annotator&&L.value.length?(l.openBlock(),l.createBlock(Mt,{key:5,parent:_.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:ge.value,onClose:Le},null,8,["parent","backgroundColor","color","active"])):l.createCommentVNode("",!0)],46,Pt))}},Nt=Xe._export_sfc(Et,[["__scopeId","data-v-73b06dd8"]]);exports.default=Nt;
;