vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
15 lines • 54.3 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CtzlfT2i.cjs"),Ne=require("./useResponsive-N8jl0-aC.cjs"),ce=require("./BaseIcon-Dhgv4Qgl.cjs"),Xe=require("./Tooltip-CnSZ7sO1.cjs"),Ve=require("./usePrinter-LlH3giBA.cjs"),Ye=require("./Slicer-rJxCx_c3.cjs"),Ze=require("./vue-ui-skeleton-MFudy6Nx.cjs"),Pe=require("./useNestedProp-B5jFEsaz.cjs"),Je=require("./PackageVersion-DdCp9lqS.cjs"),Qe=require("./PenAndPaper-4dibNTrE.cjs"),Ke=require("./useChartAccessibility-Cm7nkzTG.cjs"),et=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},tt=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function lt({dataset:v,barLineSwitch:B=6}){let f=null,_=null,L=0;if((typeof v=="number"||typeof v=="string")&&console.warn(`The provided dataset (${v}) is not sufficient to build a chart`),te(v)&&(I(v)&&(v.length<B?f=S.BAR:f=S.LINE,_=v,L=v.length),de(v))){if(!ot(v))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(v[0]),G=Object.values(v[0]);if(!U.some(E=>nt(E)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;$e(G,E=>typeof E=="number")&&(f=S.DONUT,_=v),$e(G,E=>Array.isArray(E)&&I(E))&&(Fe(v)>B?f=S.LINE:f=S.BAR,L=Fe(v),_=v.map(E=>({...E,data:rt(E,$=>I($))}))),v=v.map(E=>Ie(E)),_=_.map(E=>Ie(E))}return te(v)&&[...new Set(v.flatMap(U=>Array.isArray(U)))][0],{dataset:v,type:f,usableDataset:_,maxSeriesLength:L}}function Oe(v){return!v||te(v)&&!v.length}function te(v){return Array.isArray(v)}function I(v){if(!te(v)||Oe(v))return!1;const B=v.map(f=>Number(f));return![...new Set(B.flatMap(f=>typeof f=="number"&&!isNaN(f)))].includes(!1)}function de(v){return!te(v)||Oe(v)||!![...new Set(v.flatMap(f=>typeof f=="object"&&!Array.isArray(f)))].includes(!1)?!1:!v.map(f=>Object.keys(f).length>0).includes(!1)}function at(v,B){const f=Object.keys(v).sort(),_=Object.keys(B).sort();if(f.length!==_.length)return!1;for(let L=0;L<f.length;L+=1){const P=f[L],D=_[L];if(P!==D||typeof v[P]!=typeof B[D])return!1}return!0}function ot(v){if(v.length<=1)return!0;for(let B=0;B<v.length;B+=1)for(let f=B+1;f<v.length;f+=1)if(!at(v[B],v[f]))return!1;return!0}function nt(v){return tt.includes(v.toUpperCase())}function $e(v,B){let f=[];for(let _=0;_<v.length;_+=1)f.push(B(v[_]));return f.includes(!0)}function Fe(v){return Math.max(...[...v].flatMap(B=>Object.values(B).filter(f=>I(f)).map(f=>f.length)))}function rt(v,B){return Object.values(v).filter(f=>B(f))[0]}function Ie(v){const B={};for(let f in v)v.hasOwnProperty(f)&&(B[f.toUpperCase()]=v[f]);return B}const it=["id"],ut=["xmlns","viewBox"],st=["x","y","width","height"],ct=["x","y","width","height"],dt=["width","height"],vt=["id"],mt=["id"],ht=["id"],ft=["flood-color"],pt={key:0,class:"donut-label-connectors"},kt=["d","stroke","stroke-width","filter"],gt=["cx","cy","r","fill","filter"],yt={class:"donut"},xt=["d","fill","stroke","stroke-width","filter"],St=["d","onMouseenter","onClick"],bt={key:1,class:"donut-labels quick-animation"},Bt=["cx","cy","fill","stroke","filter"],wt=["text-anchor","x","y","fill","font-size","filter"],Et=["text-anchor","x","y","fill","font-size","filter"],At={key:2,class:"donut-hollow quick-animation"},Lt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],_t={key:0,class:"line-grid"},zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt=["x1","x2","y1","y2","stroke","stroke-width"],Vt={key:1,class:"line-axis"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],$t=["x1","x2","y1","y2","stroke","stroke-width"],Ft={key:2,class:"yLabels"},It=["x1","x2","y1","y2","stroke","stroke-width"],Ot=["x","y","font-size","fill"],Tt={key:3,class:"periodLabels"},Rt=["x1","x2","y1","y2","stroke","stroke-width"],Mt=["font-size","text-anchor","fill","transform"],Dt={class:"plots"},Ut={class:"line-plot-series"},qt=["d","stroke","stroke-width"],Ht=["d","stroke","stroke-width"],Wt=["d","stroke","stroke-width"],jt=["d","stroke","stroke-width"],Gt=["cx","cy","fill","stroke"],Xt={key:4,class:"dataLabels"},Yt=["font-size","fill","x","y"],Zt={class:"tooltip-traps"},Jt=["x","y","height","width","fill","onMouseenter","onClick"],Qt={key:0,class:"line-grid"},Kt=["x1","x2","y1","y2","stroke","stroke-width"],el=["x1","x2","y1","y2","stroke","stroke-width"],tl={key:1,class:"line-axis"},ll=["x1","x2","y1","y2","stroke","stroke-width"],al=["x1","x2","y1","y2","stroke","stroke-width"],ol={key:2,class:"yLabels"},nl=["x1","x2","y1","y2","stroke","stroke-width"],rl=["x","y","font-size","fill"],il={key:3,class:"periodLabels"},ul=["x1","x2","y1","y2","stroke","stroke-width"],sl=["font-size","text-anchor","transform","fill"],cl={class:"plots"},dl=["x","width","height","y","fill","stroke","stroke-width"],vl=["to"],ml=["from","to"],hl={key:4,class:"dataLabels"},fl=["x","y","font-size","fill"],pl={class:"tooltip-traps"},kl=["x","y","height","width","fill","onMouseenter","onClick"],gl={key:6,class:"axis-labels"},yl={key:0},xl=["font-size","fill","x","y"],Sl={key:1},bl=["font-size","fill","x","y"],Bl={key:2},wl=["font-size","fill","transform"],El={key:3},Al=["font-size","fill","transform"],Ll={key:6,class:"vue-data-ui-watermark"},Cl=["onClick"],_l=["onClick"],zl=["onClick"],Nl={key:1,class:"vue-ui-quick-chart-not-processable"},Vl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(v,{expose:B,emit:f}){const{vue_ui_quick_chart:_}=i.useConfig(),L=v,P=e.ref(null),D=e.ref(null),U=e.ref(null),G=e.ref(null),E=e.ref(i.createUid()),$=e.ref(!1),X=e.ref(null),O=e.ref(""),V=e.ref(null),he=e.ref(null),fe=e.ref(null),x=e.ref([]),pe=e.ref(0),le=e.ref(0),t=e.computed({get:()=>xe(),set:a=>a}),{svgRef:ke}=Ke.useChartAccessibility({config:{text:t.value.title}}),Te=e.computed(()=>t.value.showUserOptionsOnChartHover),ge=e.computed(()=>t.value.keepUserOptionsStateOnChartLeave),ae=e.ref(!t.value.showUserOptionsOnChartHover);function ye(a=!1){Te.value&&(ae.value=a)}function xe(){const a=Pe.useNestedProp({userConfig:L.config,defaultConfig:_});let s={};return a.theme?s={...Pe.useNestedProp({userConfig:i.themes.vue_ui_quick_chart[a.theme]||L.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:s=a,L.config&&i.hasDeepProperty(L.config,"zoomStartIndex")?s.zoomStartIndex=L.config.zoomStartIndex:s.zoomStartIndex=null,L.config&&i.hasDeepProperty(L.config,"zoomEndIndex")?s.zoomEndIndex=L.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>L.config,a=>{t.value=xe(),g.value.width=t.value.width,g.value.height=t.value.height,ae.value=!t.value.showUserOptionsOnChartHover,Be(),J.value.showTooltip=t.value.showTooltip},{deep:!0}),e.watch(()=>L.dataset,a=>{p.value=Z.value,h.value.start=0,h.value.end=p.value.maxSeriesLength,le.value+=1},{deep:!0});const Y=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),q=f,Z=e.computed(()=>{const a=lt({dataset:i.sanitizeArray(L.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return a||console.error("VueUiQuickChart : Dataset is not processable"),a}),p=e.ref(Z.value),Re=e.computed(()=>!!p.value),b=e.computed(()=>p.value?p.value.type:null);e.watch(()=>b.value,a=>{a||i.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:oe,isImaging:ne,generatePdf:Se,generateImage:be}=Ve.usePrinter({elementId:`${b.value}_${E.value}`,fileName:t.value.title||b.value}),Me=e.computed(()=>t.value.showUserOptions&&!t.value.title),g=e.ref({width:t.value.width,height:t.value.height}),J=e.ref({showTooltip:t.value.showTooltip}),re=e.ref(null);e.onMounted(()=>{Be()});function Be(){if(t.value.responsive){const a=Ne.throttle(()=>{const{width:s,height:l}=Ne.useResponsive({chart:P.value,title:t.value.title?D.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&p.value.maxSeriesLength>1?G.value:null,source:he.value,noTitle:fe.value});requestAnimationFrame(()=>{g.value.width=s,g.value.height=l})});re.value=new ResizeObserver(a),re.value.observe(P.value.parentNode)}_e()}e.onBeforeUnmount(()=>{re.value&&re.value.disconnect()});const De=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.BAR:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.DONUT:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;default:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`}});function we(a){return[...a].map(s=>s.value).reduce((s,l)=>s+l,0)}function Q(a){return t.value.blurOnHover&&![null,void 0].includes(V.value)&&V.value!==a?`url(#blur_${E.value})`:""}function Ee(a,s){x.value.includes(a)?x.value=x.value.filter(l=>l!==a):x.value.length<s&&x.value.push(a)}const Ae=e.ref(null),Le=e.ref(null),ie=e.ref(!1);function Ue(a,s){ie.value=!0;let l=a.value;const r=Z.value.dataset.find((u,m)=>a.id===`donut_${m}`).VALUE;if(x.value.includes(a.id)){let u=function(){l>r?(ie.value=!1,cancelAnimationFrame(Le.value),p.value={...p.value,dataset:p.value.dataset.map((m,C)=>a.id===`donut_${C}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,p.value={...p.value,dataset:p.value.dataset.map((m,C)=>a.id===`donut_${C}`?{...m,value:l,VALUE:l}:m)},Le.value=requestAnimationFrame(u))};x.value=x.value.filter(m=>m!==a.id),u()}else if(s.length>1){let u=function(){l<r/100?(ie.value=!1,cancelAnimationFrame(Ae.value),x.value.push(a.id),p.value={...p.value,dataset:p.value.dataset.map((m,C)=>a.id===`donut_${C}`?{...m,value:0,VALUE:0}:m)}):(l/=1.1,p.value={...p.value,dataset:p.value.dataset.map((m,C)=>a.id===`donut_${C}`?{...m,value:l,VALUE:l}:m)},Ae.value=requestAnimationFrame(u))};u()}}const F=e.ref(null);function qe(a){F.value=a}const Ce=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),w=e.computed(()=>{if(b.value!==S.DONUT)return null;const a=p.value.dataset.map((o,n)=>({...o,value:o.VALUE||o.DATA||o.SERIE||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`donut_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):Y.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],immutableValue:o.value}));function s(o,n){return i.dataLabel({v:isNaN(o.value/we(n))?0:o.value/we(n)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(o){return o.proportion*100>t.value.donutHideLabelUnderPercentage}function r(o,n){const y=Z.value.dataset.find((A,z)=>`donut_${z}`===o).VALUE;return Math.abs(String(Number(y.toFixed(0))).length-String(Number(n.toFixed(0))).length)}function u({datapoint:o,seriesIndex:n}){X.value={datapoint:o,seriesIndex:n,config:t.value,dataset:a},V.value=o.id;const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:o,seriesIndex:n,series:a,config:t.value})))O.value=y({datapoint:o,seriesIndex:n,series:a,config:t.value});else{let k="";k+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,k+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}"/></svg>`,k+=`<b>${i.applyDataLabel(t.value.formatter,o.value,i.dataLabel({p:t.value.valuePrefix,v:o.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:o,seriesIndex:n})}</b>`,k+=`<span>(${i.dataLabel({v:o.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,O.value=`<div>${k}</div>`}$.value=!0}function m(){$.value=!1,V.value=null,F.value=null}const C={centerX:g.value.width/2,centerY:g.value.height/2},N=a.filter(o=>!x.value.includes(o.id)).map(o=>o.value||0).reduce((o,n)=>o+n,0),W=a.map((o,n)=>({...o,proportion:(o.value||0)/N,value:o.value||0,absoluteValue:Z.value.dataset.find((y,k)=>`donut_${k}`===o.id).VALUE})),T=g.value.width/2,j=g.value.height/2,R=g.value.height*t.value.donutRadiusRatio;return{dataset:W.filter(o=>!x.value.includes(o.id)),legend:W,drawingArea:C,displayArcPercentage:s,isArcBigEnough:l,useTooltip:u,killTooltip:m,getSpaces:r,total:N,cx:T,cy:j,radius:R,chart:i.makeDonut({series:a.filter(o=>!x.value.includes(o.id))},T,j,R,R,1.99999,2,1,360,105.25,g.value.height*Ce.value)}}),h=e.ref({start:0,end:p.value.maxSeriesLength});function He(){_e()}const H=e.ref(null);async function _e(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&H.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),H.value&&H.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),H.value&&H.value.setEndValue(We(t.value.zoomEndIndex+1)))):(h.value={start:0,end:p.value.maxSeriesLength},le.value+=1)}function We(a){const s=p.value.maxSeriesLength;return a>s?s:a<0||t.value.zoomStartIndex!==null&&a<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:a}const je=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let a=[];I(p.value.dataset)&&(a=p.value.dataset),de(p.value.dataset)&&(a=p.value.dataset.map((u,m)=>({values:u.VALUE||u.DATA||u.SERIE||u.SERIES||u.VALUES||u.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(u=>!x.value.includes(u.id)));const s=I(a)?a.length:Math.max(...a.map(u=>u.values.length));let l=[];if(I(a))l=a;else for(let u=0;u<s;u+=1)l.push(a.map(m=>m.values[u]||0).reduce((m,C)=>(m||0)+(C||0),0));const r=Math.min(...l);return l.map(u=>u+(r<0?Math.abs(r):0))}),d=e.computed(()=>{if(b.value!==S.LINE)return null;const a={height:g.value.height,width:g.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];I(p.value.dataset)&&(l=[{values:p.value.dataset.slice(h.value.start,h.value.end),absoluteIndices:p.value.dataset.map((o,n)=>n).slice(h.value.start,h.value.end),name:t.value.title,color:Y.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"line_0"}]),de(p.value.dataset)&&(l=p.value.dataset.map((o,n)=>({...o,values:o.VALUE||o.DATA||o.SERIE||o.SERIES||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`line_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):Y.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],values:o.values.slice(h.value.start,h.value.end),absoluteIndices:o.values.map((y,k)=>k).slice(h.value.start,h.value.end)})));const r={max:Math.max(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),min:Math.min(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),maxSeries:Math.max(...l.map(o=>o.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,C=r.max<0?s.top:s.bottom-m/(u.max+m)*s.height,N=s.width/r.maxSeries,W=u.ticks.map(o=>({y:s.bottom-s.height*((o+m)/(u.max+m)),x:s.left-8,value:o})),T=l.map((o,n)=>({...o,coordinates:o.values.map((y,k)=>({x:s.left+N*(k+1)-N/2,y:s.bottom-(y+m)/(u.max+m)*s.height,value:y}))})).map(o=>{let n=[];return o.coordinates.forEach(y=>{n.push(`${y.x},${y.y} `)}),{...o,linePath:n.join(" ")}});function j(o){V.value=o,F.value=o;const n=l.map(k=>({...k,value:k.values[o],absoluteIndex:k.absoluteIndices[o]})).filter(k=>!x.value.includes(k.id));X.value={datapoint:n,seriesIndex:o,config:t.value,dataset:l};const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:n,seriesIndex:o,series:l,config:t.value})))O.value=y({datapoint:n,seriesIndex:o,series:l,config:t.value});else{let k="";t.value.xyPeriods[n[0].absoluteIndex]&&(k+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[n[0].absoluteIndex]}</div>`),n.forEach((A,z)=>{k+=`
<div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
<svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${A.color}"/></svg>
<span>${A.name}:</span>
<b>${i.applyDataLabel(t.value.formatter,A.value,i.dataLabel({p:t.value.valuePrefix,v:A.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:A,seriesIndex:z})}
</b>
</div>
`}),O.value=k}$.value=!0}function R(){V.value=null,F.value=null,$.value=!1}return{absoluteZero:C,dataset:T.filter(o=>!x.value.includes(o.id)),legend:T,drawingArea:s,extremes:r,slotSize:N,yLabels:W,useTooltip:j,killTooltip:R}}),c=e.computed(()=>{if(b.value!==S.BAR)return null;const a={height:g.value.height,width:g.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];I(p.value.dataset)&&(l=[{values:p.value.dataset.slice(h.value.start,h.value.end),absoluteIndices:p.value.dataset.map((n,y)=>y).slice(h.value.start,h.value.end),name:t.value.title,color:Y.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"bar_0"}]),de(p.value.dataset)&&(l=p.value.dataset.map((n,y)=>({...n,values:n.VALUE||n.DATA||n.SERIE||n.SERIES||n.VALUES||n.NUM||0,name:n.NAME||n.DESCRIPTION||n.TITLE||n.LABEL||`Serie ${y}`,id:`bar_${y}`})).map((n,y)=>({...n,color:n.COLOR?i.convertColorToHex(n.COLOR):Y.value[y+t.value.paletteStartIndex]||i.palette[y+t.value.paletteStartIndex]||i.palette[(y+t.value.paletteStartIndex)%i.palette.length],values:n.values.slice(h.value.start,h.value.end),absoluteIndices:n.values.map((k,A)=>A).slice(h.value.start,h.value.end)})));const r={max:Math.max(...l.filter(n=>!x.value.includes(n.id)).flatMap(n=>n.values))<0?0:Math.max(...l.filter(n=>!x.value.includes(n.id)).flatMap(n=>n.values)),min:Math.min(...l.filter(n=>!x.value.includes(n.id)).flatMap(n=>n.values)),maxSeries:Math.max(...l.filter(n=>!x.value.includes(n.id)).map(n=>n.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max,t.value.xyScaleSegments),m=u.min<0?Math.abs(u.min):0,C=s.bottom-m/(u.max+m)*s.height,N=s.width/r.maxSeries,W=u.ticks.map(n=>({y:s.bottom-s.height*((n+m)/(u.max+m)),x:s.left-8,value:n})),T=l.map((n,y)=>({...n,coordinates:n.values.map((k,A)=>{const z=(k+m)/(r.max+m)*s.height,K=Math.abs(k)/Math.abs(r.min)*(s.height-C),me=m/(r.max+m)*s.height,ee=N/l.filter(M=>!x.value.includes(M.id)).length-t.value.barGap/l.filter(M=>!x.value.includes(M.id)).length;return{x:s.left+N*A+ee*y+t.value.barGap/2,y:k>0?s.bottom-z:C,height:k>0?z-me:K,value:k,width:ee}})})),j=l.filter(n=>!x.value.includes(n.id)).map((n,y)=>({...n,coordinates:n.values.map((k,A)=>{const z=(k+m)/(r.max+m)*s.height,K=Math.abs(k)/(r.max+m)*s.height,me=m/(r.max+m)*s.height,ee=N/l.filter(M=>!x.value.includes(M.id)).length-t.value.barGap/l.filter(M=>!x.value.includes(M.id)).length;return{x:s.left+N*A+ee*y+t.value.barGap/2,y:k>0?s.bottom-z:C,height:k>0?z-me:K,value:k,width:ee}})}));function R(n){V.value=n,F.value=n;const y=l.map(A=>({...A,value:A.values[n],absoluteIndex:A.absoluteIndices[n]})).filter(A=>!x.value.includes(A.id));X.value={datapoint:y,seriesIndex:n,config:t.value,dataset:l};const k=t.value.tooltipCustomFormat;if(i.isFunction(k)&&i.functionReturnsString(()=>k({datapoint:y,seriesIndex:n,series:l,config:t.value})))O.value=k({point:y,seriesIndex:n,series:l,config:t.value});else{let A="";t.value.xyPeriods[y[0].absoluteIndex]&&(A+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[y[0].absoluteIndex]}</div>`),y.forEach((z,K)=>{A+=`
<div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
<svg viewBox="0 0 12 12" height="14" width="12"><rect x=0 y="0" width="12" height="12" rx="1" stroke="none" fill="${z.color}"/></svg>
<span>${z.name}:</span>
<b>${i.applyDataLabel(t.value.formatter,z.value,i.dataLabel({p:t.value.valuePrefix,v:z.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:z,seriesIndex:K})}
</b>
</div>
`}),O.value=A}$.value=!0}function o(){$.value=!1,V.value=null,F.value=null}return{absoluteZero:C,dataset:j.filter(n=>!x.value.includes(n.id)),legend:T,drawingArea:s,extremes:r,slotSize:N,yLabels:W,useTooltip:R,killTooltip:o}}),ue=e.ref(!1);function Ge(a){ue.value=a,pe.value+=1}function ze(){J.value.showTooltip=!J.value.showTooltip}const se=e.ref(!1);function ve(){se.value=!se.value}return B({generatePdf:Se,generateImage:be,toggleTooltip:ze,toggleAnnotator:ve}),(a,s)=>Re.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${b.value}_${E.value}`,ref_key:"quickChart",ref:P,class:e.normalizeClass({"vue-ui-quick-chart":!0,"vue-data-ui-wrapper-fullscreen":ue.value}),style:e.normalizeStyle(`background:${t.value.backgroundColor};color:${t.value.color};font-family:${t.value.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:s[5]||(s[5]=()=>ye(!0)),onMouseleave:s[6]||(s[6]=()=>ye(!1))},[t.value.userOptionsButtons.annotator?(e.openBlock(),e.createBlock(Qe.PenAndPaper,{key:0,svgRef:e.unref(ke),backgroundColor:t.value.backgroundColor,color:t.value.color,active:se.value,onClose:ve},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),Me.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:fe,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.showUserOptions&&(ge.value||ae.value)?(e.openBlock(),e.createBlock(Ve.UserOptions,{ref:"details",key:`user_option_${pe.value}`,backgroundColor:t.value.backgroundColor,color:t.value.color,isPrinting:e.unref(oe),isImaging:e.unref(ne),uid:E.value,hasTooltip:t.value.userOptionsButtons.tooltip&&t.value.showTooltip,hasPdf:t.value.userOptionsButtons.pdf,hasImg:t.value.userOptionsButtons.img,hasFullscreen:t.value.userOptionsButtons.fullscreen,hasXls:!1,isTooltip:J.value.showTooltip,isFullscreen:ue.value,titles:{...t.value.userOptionsButtonTitles},chartElement:P.value,position:t.value.userOptionsPosition,hasAnnotator:t.value.userOptionsButtons.annotator,isAnnotation:se.value,onToggleFullscreen:Ge,onGeneratePdf:e.unref(Se),onGenerateImage:e.unref(be),onToggleTooltip:ze,onToggleAnnotator:ve,style:e.normalizeStyle({visibility:ge.value?ae.value?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:r})=>[e.renderSlot(a.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:r})),void 0,!0)]),key:"0"}:void 0,a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),t.value.title?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"quickChartTitle",ref:D,class:"vue-ui-quick-chart-title",style:e.normalizeStyle(`background:transparent;color:${t.value.color};font-size:${t.value.titleFontSize}px;font-weight:${t.value.titleBold?"bold":"normal"};text-align:${t.value.titleTextAlign}`)},e.toDisplayString(t.value.title),5)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:ke,xmlns:e.unref(i.XMLNS),viewBox:De.value,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.color}`)},[e.createVNode(Je._sfc_main),a.$slots["chart-background"]&&b.value===S.BAR?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:c.value.drawingArea.left,y:c.value.drawingArea.top,width:c.value.drawingArea.width,height:c.value.drawingArea.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,st)):e.createCommentVNode("",!0),a.$slots["chart-background"]&&b.value===S.LINE?(e.openBlock(),e.createElementBlock("foreignObject",{key:1,x:d.value.drawingArea.left,y:d.value.drawingArea.top,width:d.value.drawingArea.width,height:d.value.drawingArea.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,ct)):e.createCommentVNode("",!0),a.$slots["chart-background"]&&b.value===S.DONUT?(e.openBlock(),e.createElementBlock("foreignObject",{key:2,x:0,y:0,width:g.value.width,height:g.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,dt)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${E.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${E.value}`},null,8,mt),s[7]||(s[7]=e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1))],8,vt),e.createElementVNode("filter",{id:`shadow_${E.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.donutShadowColor},null,8,ft)],8,ht)]),b.value===S.DONUT?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.showDataLabels?(e.openBlock(),e.createElementBlock("g",pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.chart,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[w.value.isArcBigEnough(l)?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(i.calcNutArrowPath)(l,{x:g.value.width/2,y:g.value.height/2},16,16,!1,!1,g.value.height*Ce.value),stroke:l.color,"stroke-width":t.value.donutLabelMarkerStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:Q(l.id)},null,8,kt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:w.value.cx,cy:w.value.cy,r:w.value.radius,fill:t.value.backgroundColor,filter:t.value.donutUseShadow?`url(#shadow_${E.value})`:""},null,8,gt),e.createElementVNode("g",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.chart,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:l.color,stroke:t.value.backgroundColor,"stroke-width":t.value.donutStrokeWidth,filter:Q(l.id)},null,8,xt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.chart,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:"transparent",onMouseenter:u=>w.value.useTooltip({datapoint:l,seriesIndex:r}),onMouseout:s[0]||(s[0]=u=>w.value.killTooltip()),onClick:u=>q("selectDatapoint",l)},null,40,St))),256))]),t.value.showDataLabels?(e.openBlock(),e.createElementBlock("g",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.chart,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[w.value.isArcBigEnough(l)?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(i.calcMarkerOffsetX)(l).x,cy:e.unref(i.calcMarkerOffsetY)(l)-3.7,fill:l.color,stroke:t.value.backgroundColor,"stroke-width":1,r:3,filter:Q(l.id)},null,8,Bt)):e.createCommentVNode("",!0),w.value.isArcBigEnough(l)?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(i.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(i.calcMarkerOffsetX)(l,!0).x,y:e.unref(i.calcMarkerOffsetY)(l),fill:t.value.color,"font-size":t.value.dataLabelFontSize,filter:Q(l.id)},e.toDisplayString(w.value.displayArcPercentage(l,w.value.chart))+" ("+e.toDisplayString(e.unref(i.applyDataLabel)(t.value.formatter,l.value,e.unref(i.dataLabel)({p:t.value.valuePrefix,v:l.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:l,seriesIndex:r}))+") ",9,wt)):e.createCommentVNode("",!0),w.value.isArcBigEnough(l,!0,20)?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(i.calcMarkerOffsetX)(l).anchor,x:e.unref(i.calcMarkerOffsetX)(l,!0).x,y:e.unref(i.calcMarkerOffsetY)(l)+t.value.dataLabelFontSize,fill:t.value.color,"font-size":t.value.dataLabelFontSize,filter:Q(l.id)},e.toDisplayString(l.name),9,Et)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.donutShowTotal?(e.openBlock(),e.createElementBlock("g",At,[e.createElementVNode("text",{"text-anchor":"middle",x:w.value.drawingArea.centerX,y:w.value.drawingArea.centerY-t.value.donutTotalLabelFontSize/2,"font-size":t.value.donutTotalLabelFontSize,fill:t.value.color},e.toDisplayString(t.value.donutTotalLabelText),9,Lt),e.createElementVNode("text",{"text-anchor":"middle",x:w.value.drawingArea.centerX,y:w.value.drawingArea.centerY+t.value.donutTotalLabelFontSize,"font-size":t.value.donutTotalLabelFontSize,fill:t.value.color},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.valuePrefix,v:w.value.total,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue})),9,Ct)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.value===S.LINE?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[t.value.xyShowGrid?(e.openBlock(),e.createElementBlock("g",_t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.yLabels,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.y<=d.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.drawingArea.left,x2:d.value.drawingArea.right,y1:l.y,y2:l.y,stroke:t.value.xyGridStroke,"stroke-width":t.value.xyGridStrokeWidth,"stroke-linecap":"round"},null,8,zt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.extremes.maxSeries+1,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:d.value.drawingArea.left+d.value.slotSize*r,x2:d.value.drawingArea.left+d.value.slotSize*r,y1:d.value.drawingArea.top,y2:d.value.drawingArea.bottom,stroke:t.value.xyGridStroke,"stroke-width":t.value.xyGridStrokeWidth,"stroke-linecap":"round"},null,8,Nt))),256))])):e.createCommentVNode("",!0),t.value.xyShowAxis?(e.openBlock(),e.createElementBlock("g",Vt,[e.createElementVNode("line",{x1:d.value.drawingArea.left,x2:d.value.drawingArea.left,y1:d.value.drawingArea.top,y2:d.value.drawingArea.bottom,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,Pt),e.createElementVNode("line",{x1:d.value.drawingArea.left,x2:d.value.drawingArea.right,y1:isNaN(d.value.absoluteZero)?d.value.drawingArea.bottom:d.value.absoluteZero,y2:isNaN(d.value.absoluteZero)?d.value.drawingArea.bottom:d.value.absoluteZero,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,$t)])):e.createCommentVNode("",!0),t.value.xyShowScale?(e.openBlock(),e.createElementBlock("g",Ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.yLabels,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.y<=d.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x+4,x2:d.value.drawingArea.left,y1:l.y,y2:l.y,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,It)):e.createCommentVNode("",!0),l.y<=d.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("text",{key:1,x:l.x,y:l.y+t.value.xyLabelsYFontSize/3,"text-anchor":"end","font-size":t.value.xyLabelsYFontSize,fill:t.value.color},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.formatter,l.value,e.unref(i.dataLabel)({p:t.value.valuePrefix,v:l.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:l,seriesIndex:r})),9,Ot)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.xyShowScale&&t.value.xyPeriods.length?(e.openBlock(),e.createElementBlock("g",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.xyPeriods.slice(h.value.start,h.value.end),(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.xyPeriodsShowOnlyAtModulo||t.value.xyPeriodsShowOnlyAtModulo&&r%Math.floor((h.value.end-h.value.start)/t.value.xyPeriodsModulo)===0||h.value.end-h.value.start<=t.value.xyPeriodsModulo?(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.drawingArea.left+d.value.slotSize*(r+1)-d.value.slotSize/2,x2:d.value.drawingArea.left+d.value.slotSize*(r+1)-d.value.slotSize/2,y1:d.value.drawingArea.bottom,y2:d.value.drawingArea.bottom+4,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,Rt)):e.createCommentVNode("",!0),!t.value.xyPeriodsShowOnlyAtModulo||t.value.xyPeriodsShowOnlyAtModulo&&r%Math.floor((h.value.end-h.value.start)/t.value.xyPeriodsModulo)===0||h.value.end-h.value.start<=t.value.xyPeriodsModulo?(e.openBlock(),e.createElementBlock("text",{key:1,"font-size":t.value.xyLabelsXFontSize,"text-anchor":t.value.xyPeriodLabelsRotation>0?"start":t.value.xyPeriodLabelsRotation<0?"end":"middle",fill:t.value.color,transform:`translate(${d.value.drawingArea.left+d.value.slotSize*(r+1)-d.value.slotSize/2}, ${d.value.drawingArea.bottom+t.value.xyLabelsXFontSize+6}), rotate(${t.value.xyPeriodLabelsRotation})`},e.toDisplayString(l),9,Mt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.dataset,(l,r)=>(e.openBlock(),e.createElementBlock("g",Ut,[t.value.lineSmooth?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("path",{d:`M ${e.unref(i.createSmoothPath)(l.coordinates)}`,stroke:t.value.backgroundColor,"stroke-width":t.value.lineStrokeWidth+1,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"quick-animation":!0,"vue-data-ui-line-animated":t.value.lineAnimated}),style:{transition:"all 0.3s ease-in-out"}},null,10,qt),e.createElementVNode("path",{d:`M ${e.unref(i.createSmoothPath)(l.coordinates)}`,stroke:l.color,"stroke-width":t.value.lineStrokeWidth,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"quick-animation":!0,"vue-data-ui-line-animated":t.value.lineAnimated}),style:{transition:"all 0.3s ease-in-out"}},null,10,Ht)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:`M ${l.linePath}`,stroke:t.value.backgroundColor,"stroke-width":t.value.lineStrokeWidth+1,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"quick-animation":!0,"vue-data-ui-line-animated":t.value.lineAnimated}),style:{transition:"all 0.3s ease-in-out"}},null,10,Wt),e.createElementVNode("path",{d:`M ${l.linePath}`,stroke:l.color,"stroke-width":t.value.lineStrokeWidth,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"quick-animation":!0,"vue-data-ui-line-animated":t.value.lineAnimated}),style:{transition:"all 0.3s ease-in-out"}},null,10,jt)],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.coordinates,(u,m)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:e.unref(i.checkNaN)(u.y),r:3,fill:l.color,stroke:t.value.backgroundColor,"stroke-width":"0.5",class:"quick-animation",style:{transition:"all 0.3s ease-in-out"}},null,8,Gt))),256))]))),256))]),t.value.showDataLabels?(e.openBlock(),e.createElementBlock("g",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.dataset,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.coordinates,(u,m)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle","font-size":t.value.dataLabelFontSize,fill:l.color,x:u.x,y:e.unref(i.checkNaN)(u.y)-t.value.dataLabelFontSize/2,class:"quick-animation",style:{transition:"all 0.3s ease-in-out"}},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.formatter,e.unref(i.checkNaN)(u.value),e.unref(i.dataLabel)({p:t.value.valuePrefix,v:e.unref(i.checkNaN)(u.value),s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:u,seriesIndex:m})),9,Yt))),256))],64))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.extremes.maxSeries,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:d.value.drawingArea.left+r*d.value.slotSize,y:d.value.drawingArea.top,height:d.value.drawingArea.height<=0?1e-5:d.value.drawingArea.height,width:d.value.slotSize<=0?1e-5:d.value.slotSize,fill:[V.value,F.value].includes(r)?t.value.xyHighlighterColor:"transparent",style:e.normalizeStyle(`opacity:${t.value.xyHighlighterOpacity}`),onMouseenter:u=>d.value.useTooltip(r),onMouseleave:s[1]||(s[1]=u=>d.value.killTooltip()),onClick:u=>q("selectDatapoint",d.value.dataset.map(m=>({...m,value:m.values[r]})))},null,44,Jt))),256))])],64)):e.createCommentVNode("",!0),b.value===S.BAR?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[t.value.xyShowGrid?(e.openBlock(),e.createElementBlock("g",Qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.yLabels,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.y<=c.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("line",{key:0,x1:c.value.drawingArea.left,x2:c.value.drawingArea.right,y1:l.y,y2:l.y,stroke:t.value.xyGridStroke,"stroke-width":t.value.xyGridStrokeWidth,"stroke-linecap":"round"},null,8,Kt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.extremes.maxSeries+1,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:c.value.drawingArea.left+c.value.slotSize*r,x2:c.value.drawingArea.left+c.value.slotSize*r,y1:c.value.drawingArea.top,y2:c.value.drawingArea.bottom,stroke:t.value.xyGridStroke,"stroke-width":t.value.xyGridStrokeWidth,"stroke-linecap":"round"},null,8,el))),256))])):e.createCommentVNode("",!0),t.value.xyShowAxis?(e.openBlock(),e.createElementBlock("g",tl,[e.createElementVNode("line",{x1:c.value.drawingArea.left,x2:c.value.drawingArea.left,y1:c.value.drawingArea.top,y2:c.value.drawingArea.bottom,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,ll),e.createElementVNode("line",{x1:c.value.drawingArea.left,x2:c.value.drawingArea.right,y1:isNaN(c.value.absoluteZero)?c.value.drawingArea.bottom:c.value.absoluteZero,y2:isNaN(c.value.absoluteZero)?c.value.drawingArea.bottom:c.value.absoluteZero,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,al)])):e.createCommentVNode("",!0),t.value.xyShowScale?(e.openBlock(),e.createElementBlock("g",ol,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.yLabels,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.y<=c.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x+4,x2:c.value.drawingArea.left,y1:l.y,y2:l.y,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,nl)):e.createCommentVNode("",!0),l.y<=c.value.drawingArea.bottom?(e.openBlock(),e.createElementBlock("text",{key:1,x:l.x,y:l.y+t.value.xyLabelsYFontSize/3,"text-anchor":"end","font-size":t.value.xyLabelsYFontSize,fill:t.value.color},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.formatter,l.value,e.unref(i.dataLabel)({p:t.value.valuePrefix,v:l.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:l,seriesIndex:r})),9,rl)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.xyShowScale&&t.value.xyPeriods.length?(e.openBlock(),e.createElementBlock("g",il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.xyPeriods.slice(h.value.start,h.value.end),(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:c.value.drawingArea.left+c.value.slotSize*(r+1)-c.value.slotSize/2,x2:c.value.drawingArea.left+c.value.slotSize*(r+1)-c.value.slotSize/2,y1:c.value.drawingArea.bottom,y2:c.value.drawingArea.bottom+4,stroke:t.value.xyAxisStroke,"stroke-width":t.value.xyAxisStrokeWidth,"stroke-linecap":"round"},null,8,ul))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.xyPeriods.slice(h.value.start,h.value.end),(l,r)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.xyLabelsXFontSize,"text-anchor":t.value.xyPeriodLabelsRotation>0?"start":t.value.xyPeriodLabelsRotation<0?"end":"middle",transform:`translate(${c.value.drawingArea.left+c.value.slotSize*(r+1)-c.value.slotSize/2}, ${c.value.drawingArea.bottom+t.value.xyLabelsXFontSize+6}) rotate(${t.value.xyPeriodLabelsRotation})`,fill:t.value.color},e.toDisplayString(l),9,sl))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.dataset,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.coordinates,(u,m)=>(e.openBlock(),e.createElementBlock("rect",{x:u.x,width:u.width<=0?1e-5:u.width,height:e.unref(i.checkNaN)(u.height<=0?1e-5:u.height),y:e.unref(i.checkNaN)(u.y),fill:l.color,stroke:t.value.backgroundColor,"stroke-width":t.value.barStrokeWidth,"stroke-linecap":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.barAnimated&&u.value<0})},[t.value.barAnimated&&u.value>0&&!e.unref(oe)&&!e.unref(ne)?(e.openBlock(),e.createElementBlock("animate",{key:0,attributeName:"height",from:0,to:u.height,dur:"0.5s"},null,8,vl)):e.createCommentVNode("",!0),t.value.barAnimated&&u.value>0&&!e.unref(oe)&&!e.unref(ne)?(e.openBlock(),e.createElementBlock("animate",{key:1,attributeName:"y",from:c.value.absoluteZero,to:c.value.absoluteZero-u.height,dur:"0.5s"},null,8,ml)):e.createCommentVNode("",!0)],10,dl))),256))],64))),256))]),t.value.showDataLabels?(e.openBlock(),e.createElementBlock("g",hl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.dataset,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.coordinates,(u,m)=>(e.openBlock(),e.createElementBlock("text",{x:u.x+u.width/2,y:e.unref(i.checkNaN)(u.y)-t.value.dataLabelFontSize/2,"text-anchor":"middle","font-size":t.value.dataLabelFontSize,fill:l.color,class:"quick-animation"},e.toDisplayString(e.unref(i.applyDataLabel)(t.value.formatter,e.unref(i.checkNaN)(u.value),e.unref(i.dataLabel)({p:t.value.valuePrefix,v:e.unref(i.checkNaN)(u.value),s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:u,seriesIndex:m})),9,fl))),256))],64))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.extremes.maxSeries,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{x:c.value.drawingArea.left+r*c.value.slotSize,y:c.value.drawingArea.top,height:c.value.drawingArea.height<=0?1e-5:c.value.drawingArea.height,width:c.value.slotSize<=0?1e-5:c.value.slotSize,fill:[V.value,F.value].includes(r)?t.value.xyHighlighterColor:"transparent",style:e.normalizeStyle(`opacity:${t.value.xyHighlighterOpacity}`),onMouseenter:u=>c.value.useTooltip(r),onMouseleave:s[2]||(s[2]=u=>c.value.killTooltip()),onClick:u=>q("selectDatapoint",c.value.dataset.map(m=>({...m,value:m.values[r]})))},null,44,kl))),256))])],64)):e.createCommentVNode("",!0),[S.LINE,S.BAR].includes(b.value)?(e.openBlock(),e.createElementBlock("g",gl,[t.value.xAxisLabel&&b.value===S.LINE?(e.openBlock(),e.createElementBlock("g",yl,[e.createElementVNode("text",{"font-size":t.value.axisLabelsFontSize,fill:t.value.color,"text-anchor":"middle",x:d.value.drawingArea.left+d.value.drawingArea.width/2,y:g.value.height-t.value.axisLabelsFontSize/3},e.toDisplayString(t.value.xAxisLabel),9,xl)])):e.createCommentVNode("",!0),t.value.xAxisLabel&&b.value===S.BAR?(e.openBlock(),e.createElementBlock("g",Sl,[e.createElementVNode("text",{"font-size":t.value.axisLabelsFontSize,fill:t.value.color,"text-anchor":"middle",x:c.value.drawingArea.left+c.value.drawingArea.width/2,y:g.value.height-t.value.axisLabelsFontSize/3},e.toDisplayString(t.value.xAxisLabel),9,bl)])):e.createCommentVNode("",!0),t.value.yAxisLabel&&b.value===S.LINE?(e.openBlock(),e.createElementBlock("g",Bl,[e.createElementVNode("text",{"font-size":t.value.axisLabelsFontSize,fill:t.value.color,transform:`translate(${t.value.axisLabelsFontSize}, ${d.value.drawingArea.top+d.value.drawingArea.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.yAxisLabel),9,wl)])):e.createCommentVNode("",!0),t.value.yAxisLabel&&b.value===S.BAR?(e.openBlock(),e.createElementBlock("g",El,[e.createElementVNode("text",{"font-size":t.value.axisLabelsFontSize,fill:t.value.color,transform:`translate(${t.value.axisLabelsFontSize}, ${c.value.drawingArea.top+c.value.drawingArea.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.yAxisLabel),9,Al)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],12,ut)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ze.default,{key:5,config:{type:"line",style:{backgroundColor:t.value.backgroundColor,line:{axis:{color:t.value.xyAxisStroke},path:{color:t.value.xyAxisStroke,strokeWidth:.5}}}}},null,8,["config"])),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ll,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(ne)})),void 0,!0)])):e.createCommentVNode("",!0),[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&p.value.maxSeriesLength>1?(e.openBlock(),e.createElementBlock("div",{key:`slicer_${le.value}`,ref_key:"quickChartSlicer",ref:G},[(e.openBlock(),e.createBlock(Ye.Slicer,{ref_key:"slicerComponent",ref:H,key:`slicer_${le.value}`,background:t.value.zoomColor,borderColor:t.value.backgroundColor,fontSize:t.value.zoomFontSize,useResetSlot:t.value.zoomUseResetSlot,labelLeft:t.value.xyPeriods[h.value.start]?t.value.xyPeriods[h.value.start]:"",labelRight:t.value.xyPeriods[h.value.end-1]?t.value.xyPeriods[h.value.end-1]:"",textColor:t.value.color,inputColor:t.value.zoomColor,selectColor:t.value.zoomHighlightColor,max:p.value.maxSeriesLength,min:0,valueStart:h.value.start,valueEnd:h.value.end,smoothMinimap:t.value.zoomMinimap.smooth,minimapSelectedColor:t.value.zoomMinimap.selectedColor,minimapSelectedColorOpacity:t.value.zoomMinimap.selectedColorOpacity,minimapSelectionRadius:t.value.zoomMinimap.selectionRadius,minimapLineColor:t.value.zoomMinimap.lineColor,minimap:je.value,minimapIndicatorColor:t.value.zoomMinimap.indicatorColor,verticalHandles:t.value.zoomMinimap.verticalHandles,minimapSelectedIndex:F.value,start:h.value.start,"onUpdate:start":s[3]||(s[3]=l=>h.value.start=l),end:h.value.end,"onUpdate:end":s[4]||(s[4]=l=>h.value.end=l),refreshStartPoint:t.value.zoomStartIndex!==null?t.value.zoomStartIndex:0,refreshEndPoint:t.value.zoomEndIndex!==null?t.value.zoomEndIndex+1:p.value.maxSeriesLength,enableRangeHandles:t.value.zoomEnableRangeHandles,enableSelectionDrag:t.value.zoomEnableSelectionDrag,onReset:He,onTrapMouse:qe},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","smoothMinimap","minimapSelectedColor","minimapSelectedColorOpacity","minimapSelectionRadius","minimapLineColor","minimap","minimapIndicatorColor","verticalHandles","minimapSelectedIndex","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"]))])):e.createCommentVNode("",!0),t.value.showLegend?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"quickChartLegend",ref:U,class:"vue-ui-quick-chart-legend",style:e.normalizeStyle(`background:transparent;color:${t.value.color}`)},[b.value===S.DONUT?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(w.value.legend,(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-quick-chart-legend-item",onClick:u=>{Ue(l,w.value.dataset),q("selectLegend",l)},style:e.normalizeStyle(`cursor: ${w.value.legend.length>1?"pointer":"default"}; opacity:${x.value.includes(l.id)?"0.5":"1"}`)},[t.value.useCustomLegend?e.renderSlot(a.$slots,"legend",e.mergeProps({key:0,ref_for:!0},{legend:l}),void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(ce.default,{name:t.value.legendIcon,stroke:l.color,size:t.value.legendIconSize},null,8,["name","stroke","size"]),e.createElementVNode("span",{style:e.normalizeStyle(`font-siz