UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

7 lines (6 loc) 47.4 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-_gyicZFE.cjs"),Te=require("./useNestedProp-BJQoarHp.cjs"),Me=require("./useResponsive-N8jl0-aC.cjs"),Pe=require("./usePrinter-BRTNfg7r.cjs"),ot=require("./Slicer-9-SDSvre.cjs"),rt=require("./Tooltip-C06-4zGf.cjs"),st=require("./Title-CsERtJKI.cjs"),nt=require("./Legend-tU5gqFrZ.cjs"),it=require("./vue-ui-accordion-8mzPx86h.cjs"),ut=require("./DataTable-DL8_xKlk.cjs"),ct=require("./vue-ui-skeleton-KlT3Rmkn.cjs"),dt=require("./PackageVersion-DHtx9fnE.cjs"),ht=require("./PenAndPaper-DPoMEHE6.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-C_rBdSHr.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Pt=["x","y","width","rx","height","fill","stroke","stroke-width"],Ft=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Fe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),P=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),ee=e.ref(null),Z=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),F=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{Q()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:K,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),K.value=!t.value.userOptions.showOnChartHover,Q(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Pe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),q=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{Q()});function Q(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:P.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(P.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),r=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:L.value[l]})}function we(l){F.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id})),o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))Z.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=` <div style="display:flex;flex-direction:row;align-items:center;gap:4px"> <svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/>${Oe.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${p.absoluteIndex})"/>`:""}</svg> ${p.name}${i||n?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${n?u.dataLabel({v:isNaN(p.value/o)?0:Math.abs(p.value)/o*100,s:"%",r:N}):""}${$[1]} </div> `}),Z.value=`<div>${R}</div>`}}function Ye(l){A.value=l,te.value+=1}function Be(){y.value.showTable=!y.value.showTable}function Ce(){y.value.dataLabels.show=!y.value.dataLabels.show}function Se(){y.value.showTooltip=!y.value.showTooltip}function Xe(){return g.value}const ze=e.computed(()=>{if(g.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const l=g.value.map(({name:a,color:o})=>({label:a,color:o})),r=[];for(let a=c.value.start;a<c.value.end;a+=1){const o=[t.value.style.chart.grid.x.timeLabels.values[a]||a+1];S.value.forEach(i=>{o.push(Number((i.series[a]||0).toFixed(t.value.table.td.roundingValue)))}),r.push(o)}return{head:l,body:r}});function Le(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=["",...ze.value.head.map(n=>n.label)],a=ze.value.body,o=l.concat([r]).concat(a),i=u.createCsvContent(o);u.downloadCsv({csvContent:i,title:t.value.style.chart.title.text||"vue-ui-stackbar"})}const W=e.computed(()=>{const l=[""].concat(g.value.map(i=>i.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 r=[];for(let i=0;i<z.value;i+=1){const n=g.value.map(b=>b.series[i]??0).reduce((b,E)=>b+E,0);r.push([t.value.style.chart.grid.x.timeLabels.values.slice(c.value.start,c.value.end)[i]??i+1].concat(g.value.map(b=>(b.series[i]??0).toFixed(t.value.table.td.roundingValue))).concat((n??0).toFixed(t.value.table.td.roundingValue)))}const a={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},o=[t.value.table.columnNames.period].concat(g.value.map(i=>i.name)).concat(t.value.table.columnNames.total);return{head:l,body:r.slice(0,c.value.end-c.value.start),config:a,colNames:o}});function Ge(l,r){if(J("selectLegend",g.value.find(a=>a.absoluteIndex===l)),f.value.includes(r.id))f.value=f.value.filter(a=>a!==r.id);else{if(f.value.length===S.value.length-1)return;f.value.push(r.id)}}const _e=e.computed(()=>S.value.map((l,r)=>({...l,shape:"square"})).map(l=>({...l,opacity:f.value.includes(l.id)?.5:1,segregate:()=>Ge(l.absoluteIndex,l),isSegregated:f.value.includes(l.id)}))),Je=e.computed(()=>({cy:"stackbar-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":""})),Y=e.ref(!1);function j(){Y.value=!Y.value}function Ee(l,r){const a=JSON.parse(JSON.stringify(g.value)).map(o=>({name:o.name,value:o.series[r]===0?0:(o.signedSeries[r]===-1&&o.series[r]>=0?-o.series[r]:o.series[r])||null,proportion:o.proportions[r]||null,color:o.color,id:o.id}));J("selectTimeLabel",{datapoint:a,absoluteIndex:l.absoluteIndex,label:l.text})}function Ne(l,r){return t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?t.value.style.chart.bars.dataLabels.hideEmptyPercentages?r>0:!0:t.value.style.chart.bars.dataLabels.hideEmptyValues?l!==0:!0}return Fe({getData:Xe,generatePdf:ve,generateCsv:Le,generateImage:me,toggleTable:Be,toggleLabels:Ce,toggleTooltip:Se,toggleAnnotator:j}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{id:`stackbar_${C.value}`,ref_key:"stackbarChart",ref:P,class:e.normalizeClass({"vue-ui-stackbar":!0,"vue-data-ui-wrapper-fullscreen":A.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:r[6]||(r[6]=()=>e.unref(ne)(!0)),onMouseleave:r[7]||(r[7]=()=>e.unref(ne)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ht.PenAndPaper,{key:0,svgRef:e.unref(ue),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:j},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:ae,style:"width:100%;background:transparent;padding-bottom:24px"},[e.createVNode(st._sfc_main,{config:{title:{cy:"stackbar-title",...t.value.style.chart.title},subtitle:{cy:"stackbar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&T.value&&(e.unref(ie)||e.unref(K))?(e.openBlock(),e.createBlock(Pe.UserOptions,{ref:"details",key:`user_option_${te.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(de),isImaging:e.unref(he),uid:C.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,chartElement:P.value,position:t.value.userOptions.position,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:Ye,onGeneratePdf:e.unref(ve),onGenerateCsv:Le,onGenerateImage:e.unref(me),onToggleTable:Be,onToggleLabels:Ce,onToggleTooltip:Se,onToggleAnnotator:j,style:e.normalizeStyle({visibility:e.unref(ie)?e.unref(K)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:o})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:o})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:ue,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${s.value.chartWidth<=0?10:s.value.chartWidth} ${s.value.chartHeight<=0?10:s.value.chartHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(dt._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:s.value.left,y:s.value.top,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,pt)):e.createCommentVNode("",!0),t.value.style.chart.bars.gradient.show?(e.openBlock(),e.createElementBlock("defs",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient_${a.id}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,wt),e.createElementVNode("stop",{offset:"61.8%","stop-color":e.unref(u.lightenHexColor)(a.color,t.value.style.chart.bars.gradient.intensity/100)},null,8,Bt),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ct)],8,xt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,St))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(c.value.end-c.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:s.value.top+d.value*o,y2:s.value.top+d.value*o,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,zt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showVerticalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(c.value.end-c.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left+d.value*o,x2:s.value.left+d.value*o,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Lt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,_t))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[l.$slots.pattern?(e.openBlock(),e.createElementBlock("defs",Et,[e.renderSlot(l.$slots,"pattern",e.mergeProps({ref_for:!0},{seriesIndex:a.absoluteIndex,patternId:`pattern_${C.value}_${a.absoluteIndex}`}),void 0,!0)])):e.createCommentVNode("",!0),t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:i,y:a.y[n]<0?0:a.y[n],height:a.height[n]<0?1e-4:a.height[n]||0,rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Nt))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:i,y:a.y[n]<0?0:a.y[n],height:a.height[n]<0?1e-4:a.height[n]||0,rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:`url(#pattern_${C.value}_${a.absoluteIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Vt))),256))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(u.forceValidValue)(i,s.value.left),y:a.horizontal_y[n]<0?0:a.horizontal_y[n],width:e.unref(u.forceValidValue)(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n]),rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Tt))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(u.forceValidValue)(i,s.value.left),y:a.horizontal_y[n]<0?0:a.horizontal_y[n],width:e.unref(u.forceValidValue)(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n]),rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:`url(#pattern_${C.value}_${a.absoluteIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Pt))),256))])):e.createCommentVNode("",!0)],64))]))),256)),t.value.style.chart.grid.x.showAxis?(e.openBlock(),e.createElementBlock("line",{key:6,x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":t.value.style.chart.grid.x.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ft)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showAxis&&!t.value.style.chart.bars.distributed?(e.openBlock(),e.createElementBlock("line",{key:7,x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":t.value.style.chart.grid.y.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,It)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.axisName.show&&t.value.style.chart.grid.x.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:8,x:s.value.left+s.value.width/2,y:s.value.chartHeight+t.value.style.chart.grid.x.axisName.offsetY,"font-size":t.value.style.chart.grid.x.axisName.fontSize,fill:t.value.style.chart.grid.x.axisName.color,"font-weight":t.value.style.chart.grid.x.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.x.axisName.text),9,Rt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisName.show&&t.value.style.chart.grid.y.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:9,transform:`translate(${t.value.style.chart.grid.y.axisName.fontSize+t.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top+s.value.height/2}) rotate(-90)`,"font-size":t.value.style.chart.grid.y.axisName.fontSize,fill:t.value.style.chart.grid.y.axisName.color,"font-weight":t.value.style.chart.grid.y.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.y.axisName.text),9,Ot)):e.createCommentVNode("",!0),y.value.dataLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ne(a.series[n],a.proportions[n])?(e.openBlock(),e.createElementBlock("text",{key:0,x:i+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2,y:a.y[n]+a.height[n]/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(u.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?ke(a.proportions[n]*100,a,o,n):U(a.series[n],a,o,n,a.signedSeries[n])),9,Dt)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.left+d.value*o+d.value/2,y:s.value.top-t.value.style.chart.bars.totalValues.fontSize/3,"text-anchor":"middle","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(U(a.value,a,o,a.sign)),9,qt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),y.value.dataLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ne(a.series[n],a.proportions[n])?(e.openBlock(),e.createElementBlock("text",{key:0,x:i+(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n])/2,y:a.horizontal_y[n]+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(u.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?ke(a.proportions[n]*100,a,o,n):U(a.series[n],a,o,n,a.signedSeries[n])),9,Ht)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.right+t.value.style.chart.bars.totalValues.fontSize/3,y:s.value.top+d.value*o+d.value/2,"text-anchor":"start","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(U(a.value,a,o,a.sign)),9,Wt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.left-6,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1},null,8,Yt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{x:a.x,y:a.y+t.value.style.chart.grid.y.axisLabels.fontSize/3,"font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Xt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.bottom,y2:s.value.bottom+6,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",transform:`translate(${a.horizontal_x}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Jt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.mergeProps({ref_for:!0},{x:s.value.left+d.value*o+d.value/2,y:s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*o+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",show:!0}),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.x.timeLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*o+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,style:{cursor:"pointer"},onClick:()=>Ee(a,o)},e.toDisplayString(a.text),9,Qt))),256))]))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.mergeProps({ref_for:!0},{x:s.value.left-8,y:s.value.top+d.value*o+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:null,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:"end",show:!0}),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"end","font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,x:s.value.left-8,y:s.value.top+d.value*o+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,style:{cursor:"pointer"},onClick:()=>Ee(a,o)},e.toDisplayString(a.text),9,ta))),256))]))],64)):e.createCommentVNode("",!0),y.value.showTooltip&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:16},e.renderList(c.value.end-c.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+o*d.value,y:s.value.top,width:d.value,height:s.value.height<0?0:s.value.height,onClick:i=>xe(o),onMouseenter:i=>we(o),onMouseleave:r[0]||(r[0]=i=>{F.value=null,D.value=!1}),fill:o===F.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,aa))),256)):e.createCommentVNode("",!0),y.value.showTooltip&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:17},e.renderList(c.value.end-c.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left,y:s.value.top+o*d.value,width:s.value.width<0?0:s.value.width,height:d.value,onClick:i=>xe(o),onMouseenter:i=>we(o),onMouseleave:r[1]||(r[1]=i=>{F.value=null,D.value=!1}),fill:o===F.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,la))),256)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({...s.value})),void 0,!0)],12,ft)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",oa,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(de)||e.unref(he)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ct.default,{key:5,config:{type:"bar",style:{backgroundColor:t.value.style.chart.backgroundColor,bar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartSlicer",ref:oe,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&z.value>1?(e.openBlock(),e.createBlock(ot.Slicer,{ref_key:"slicerComponent",ref:M,key:`slicer_${se.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.x.timeLabels.values[c.value.start]?t.value.style.chart.grid.x.timeLabels.values[c.value.start]:"",labelRight:t.value.style.chart.grid.x.timeLabels.values[c.value.end-1]?t.value.style.chart.grid.x.timeLabels.values[c.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:Math.max(...G.dataset.map(a=>a.series.length)),min:0,valueStart:c.value.start,valueEnd:c.value.end,start:c.value.start,"onUpdate:start":r[2]||(r[2]=a=>c.value.start=a),end:c.value.end,"onUpdate:end":r[3]||(r[3]=a=>c.value.end=a),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:Math.max(...G.dataset.map(a=>a.series.length)),enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:be},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0)],4),e.createVNode(rt._sfc_main,{show:y.value.showTooltip&&D.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,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:P.value,content:Z.value,isFullscreen:A.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...ee.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.createElementVNode("div",{ref_key:"chartLegend",ref:le},[t.value.style.chart.legend.show&&T.value?(e.openBlock(),e.createBlock(nt.Legend,{key:0,legendSet:_e.value,config:Je.value,onClickMarker:r[4]||(r[4]=({legend:a})=>a.segregate())},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,ra)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:o})=>[e.createVNode(mt._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${C.value}_${o})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_e.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:re,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),c.value.end-c.value.start<200?(e.openBlock(),e.createBlock(it.default,{key:7,hideDetails:"",config:{open:y.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:e.withCtx(()=>[e.createVNode(ut.DataTable,{colNames:W.value.colNames,head:W.value.head,body:W.value.body,config:W.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[5]||(r[5]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,sa)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(isNaN(Number(a))?a:e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,bt))}},ia=yt._export_sfc(na,[["__scopeId","data-v-53cfad0e"]]);exports.default=ia;