UNPKG

vue-data-ui-hq

Version:

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

5 lines (4 loc) 34.7 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-ZfICPrrM.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./Title-FbHK83tB.cjs"),ye=require("./usePrinter-B-gh2f22.cjs"),De=require("./Tooltip-C7TJODUx.cjs"),ge=require("./Legend-HgHPyA_4.cjs"),Oe=require("./vue-ui-skeleton-Bvmpr51u.cjs"),Fe=require("./BaseIcon-DO69J5Rk.cjs"),Me=require("./vue-ui-accordion-Dp6uTsJi.cjs"),ve=require("./useNestedProp-C14rfl0j.cjs"),Ie=require("./PackageVersion-D3dK8oA3.cjs"),Ae=require("./PenAndPaper-PL3bp4ud.cjs"),Re=require("./useUserOptionState-BgepsfED.cjs"),qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),He=["id"],Ue=["onClick"],Xe=["xmlns","viewBox"],je=["width","height"],Ge=["id"],We=["stop-color"],Ye=["stop-color"],Ke=["x","y","width","height","fill","rx"],Je=["x","y","width","height","fill","rx","stroke","stroke-width"],Qe=["x2","y1","y2","stroke","stroke-width"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],et=["x","y","text-anchor","font-size","fill","font-weight"],tt=["x","y","font-size","fill","font-weight"],lt=["x","y","font-size","fill","font-weight"],nt=["x","y","font-size","fill","font-weight"],at=["y","width","height","fill","onMouseenter"],ot={key:6,class:"vue-data-ui-watermark"},rt=["onClick"],ut={style:"width:100%;padding-top: 36px;position:relative"},st={class:"vue-ui-data-table"},it={key:0},ct={style:{width:"100%"}},dt=["data-cell"],ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht=["data-cell"],pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yt=["data-cell"],gt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vt=["data-cell"],bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},mt=["data-cell"],kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ct=["data-cell"],_t={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},xt=["data-cell"],Nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},wt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:me,emit:ke}){e.useCssVars(l=>({"0e4b04ce":l.tdo}));const{vue_ui_vertical_bar:Ce}=o.useConfig(),y=be,B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(o.createUid()),_e=e.ref(null),D=e.ref(!1),O=e.ref(""),E=e.ref(0),xe=e.ref(null),H=e.ref(0),N=e.ref(null),U=e.ref(null),F=e.ref(null),X=e.ref(null),j=e.ref(null),G=e.ref(0),M=e.ref(0),Ne=ke,t=e.computed({get:()=>K(),set:l=>l}),{userOptionsVisible:I,setUserOptionsVisibility:W,keepUserOptionState:Y}=Re.useUserOptionState({config:t.value});function K(){const l=ve.useNestedProp({userConfig:y.config,defaultConfig:Ce});return l.theme?{...ve.useNestedProp({userConfig:o.themes.vue_ui_vertical_bar[l.theme]||y.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>y.config,l=>{t.value=K(),I.value=!t.value.showOnChartHover,ae(),G.value+=1,M.value+=1,s.value=t.value.style.chart.layout.bars.height,d.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,P,{deep:!0});const{isPrinting:J,isImaging:Q,generatePdf:Z,generateImage:ee}=ye.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),we=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),le=e.ref(null),ne=e.ref(!1),$e=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{ae()});function ae(){if(o.objectIsEmpty(y.dataset)&&o.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,a)=>l+a,0),Se(),t.value.responsive){const l=pe.throttle(()=>{const{width:a,height:n}=pe.useResponsive({chart:N.value,title:t.value.style.chart.title.text?U.value:null,legend:t.value.style.chart.legend.show?F.value:null,source:X.value,noTitle:j.value});ue.value=a,s.value=n/E.value-d.value*2});L.value=new ResizeObserver(l),L.value.observe(N.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function Se(){new ResizeObserver(a=>{a.forEach(n=>{ne.value=n.contentRect.width<$e.value})}).observe(le.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),oe=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.dataset.forEach((l,a)=>{!l.value&&!l.children&&o.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${a})`}),l.children&&(o.objectIsEmpty(l.children)?o.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${a})`}):l.children.forEach((n,r)=>{[null,void 0].includes(n.name)&&o.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((l,a)=>{const n=`vertical_parent_${a}_${C.value}`,r=l.children&&l.children.length>0,f=o.checkNaN(l.value?l.value:r?l.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),c=f>=0?1:-1;return{...l,id:n,shape:"square",opacity:v.value.includes(n)?.5:1,value:Math.abs(f),sign:c,hasChildren:r,isChild:!1,segregate:()=>V(n),isSegregated:v.value.includes(n),color:o.convertColorToHex(l.color)||te.value[a]||o.palette[a]||o.palette[a%o.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((h,m)=>oe.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:o.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:n,parentName:l.name,parentValue:f,parentSign:c,id:`vertical_child_${a}_${m}_${C.value}`,childIndex:m,color:o.convertColorToHex(h.color)||o.convertColorToHex(l.color)||te.value[a]||o.palette[a]||o.palette[a%o.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===l.children.length-1}))}}).toSorted((l,a)=>oe.value?a.value-l.value:l.value-a.value))),re=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),s=e.ref(t.value.style.chart.layout.bars.height),d=e.ref(t.value.style.chart.layout.bars.gap),Ve=e.computed(()=>(s.value+d.value)*E.value),ue=e.ref(512),i=e.computed(()=>({width:ue.value,height:Ve.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:i.value.padding.top+i.value.padding.bottom+i.value.height,top:i.value.padding.top,left:i.value.padding.left,right:i.value.width-i.value.padding.right,bottom:i.value.padding.top+i.value.height,width:i.value.width-(i.value.padding.left+i.value.padding.right)}));function P(){E.value=x.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,a)=>l+a,0)}const v=e.ref([]);function V(l){v.value.includes(l)?v.value=v.value.filter(a=>a!==l):v.value.push(l),P(),Ne("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(l=>!v.value.includes(l.id))),b=e.computed(()=>x.value.map(l=>Math.abs(l.value)).reduce((l,a)=>l+a,0));function se(l,a=!1,n=0){return a?o.dataLabel({v:o.checkNaN(Math.abs(l)/b.value*100),s:"%",r:n}):Math.abs(l)/b.value}const w=e.computed(()=>x.value.flatMap(l=>l.hasChildren?l.children:l)),$=e.computed(()=>w.value.map(l=>l.sign).includes(-1)),Te=e.computed(()=>Math.max(...x.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(a=>a.value)):l.value)));function k(l){const a=l/Te.value;return u.value.width/($.value?2:1)*a}function Be(l){return k(l)+u.value.left}function T(l,a){const n=x.value.find(c=>c.id===l.parentId),r=u.value.top+(d.value+s.value)*a,f=n.children.length*(d.value+s.value);return{y:r+f/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:n.name,value:[void 0,NaN,null].includes(n.value)?"":n.sign===1?n.value:-n.value,percentageToTotal:isNaN(n.value/b.value)?"":se(n.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:n.sign}}function Ee(){return x.value}const A=e.ref(null),R=e.ref(null);function Le(l,a){R.value={datapoint:l,seriesIndex:a,series:_.value,config:t.value},D.value=!0,A.value=l.id;let n="";const r=l.isChild?l.parentName:l.name,f=l.isChild?l.name:"",c=t.value.style.chart.tooltip.customFormat;o.isFunction(c)&&o.functionReturnsString(()=>c({datapoint:l,series:_.value,config:t.value,seriesIndex:a}))?O.value=c({datapoint:l,series:_.value,config:t.value,seriesIndex:a}):(n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;"> <div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${l.color}"/></svg> ${r}</div> ${f?`<div>${f}</div>`:""} </div>`,t.value.style.chart.tooltip.showValue&&(n+=`<div>${t.value.translations.value}: <b>${o.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.sign===1?l.value:-l.value,o.dataLabel({p:t.value.style.chart.tooltip.prefix,v:l.sign===1?l.value:-l.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(n+=`<div>${t.value.translations.percentageToTotal} : <b>${o.dataLabel({v:Math.abs(l.value)/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,l.isChild&&(n+=`<div>${t.value.translations.percentageToSerie}: <b>${o.dataLabel({v:Math.abs(l.value)/Math.abs(l.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),O.value=`<div style="text-align:left">${n}</div>`)}function ie(l,a,n,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const f=o.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,o.checkNaN(r===-1&&l>=0?-l:l),o.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:o.checkNaN(r===-1&&l>=0?-l:l),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:a,seriesIndex:n}),c=`(${se(l,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${f}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${c}`:""}`}const g=e.computed(()=>{const l=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],a=w.value.map(n=>n.isChild?n.isFirstChild?{color:n.color,parentName:n.parentName,parentValue:n.parentValue,percentageToTotal:n.parentValue/b.value,childName:n.name,childValue:n.sign===1?n.value:-n.value,childPercentageToParent:Math.abs(n.value)/Math.abs(n.parentValue),childPercentageToTotal:Math.abs(n.value)/b.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:n.name,childValue:n.sign===1?n.value:-n.value,childPercentageToParent:Math.abs(n.value)/Math.abs(n.parentValue),childPercentageToTotal:Math.abs(n.value)/b.value}:{color:n.color,parentName:n.name,parentValue:n.sign===1?n.value:-n.value,percentageToTotal:Math.abs(n.value)/b.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:l,body:a}});function ce(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=g.value.head,n=g.value.body.map(c=>[c.parentName,c.parentValue,c.percentageToTotal,c.childName,c.childValue,c.childPercentageToParent,c.childPercentageToTotal]),r=l.concat([a]).concat(n),f=o.createCsvContent(r);o.downloadCsv({csvContent:f,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function Pe(l){S.value=l,H.value+=1}function de(){p.value.showTable=!p.value.showTable}function fe(){p.value.sortDesc=!p.value.sortDesc,P()}function he(){p.value.showTooltip=!p.value.showTooltip}const z=e.ref(!1);function q(){z.value=!z.value}return me({getData:Ee,recalculateHeight:P,generatePdf:Z,generateCsv:ce,generateImage:ee,toggleTable:de,toggleSort:fe,toggleTooltip:he,toggleAnnotator:q}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${e.unref(S)?"vue-data-ui-wrapper-fullscreen":""} ${e.unref(t).useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:N,id:`vue-ui-vertical-bar_${e.unref(C)}`,style:e.normalizeStyle(`font-family:${e.unref(t).style.fontFamily};width:100%; text-align:center;background:${e.unref(t).style.chart.backgroundColor};${e.unref(t).responsive?"height: 100%":""}`),onMouseenter:a[5]||(a[5]=()=>e.unref(W)(!0)),onMouseleave:a[6]||(a[6]=()=>e.unref(W)(!1))},[e.unref(t).userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:e.unref(N),backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,active:e.unref(z),onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.unref(we)?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:j,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),e.unref(t).style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:U,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${e.unref(G)}`,config:{title:{cy:"vertical-bar-div-title",...e.unref(t).style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...e.unref(t).style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),e.unref(t).userOptions.show&&e.unref(B)&&(e.unref(Y)||e.unref(I))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref_key:"details",ref:_e,key:`user_options_${e.unref(H)}`,backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:e.unref(C),hasTooltip:e.unref(t).userOptions.buttons.tooltip&&e.unref(t).style.chart.tooltip.show,hasPdf:e.unref(t).userOptions.buttons.pdf,hasImg:e.unref(t).userOptions.buttons.img,hasXls:e.unref(t).userOptions.buttons.csv,hasTable:e.unref(t).userOptions.buttons.table,hasSort:e.unref(t).userOptions.buttons.sort,hasFullscreen:e.unref(t).userOptions.buttons.fullscreen,isFullscreen:e.unref(S),isTooltip:e.unref(p).showTooltip,titles:{...e.unref(t).userOptions.buttonTitles},chartElement:e.unref(N),position:e.unref(t).userOptions.position,hasAnnotator:e.unref(t).userOptions.buttons.annotator,isAnnotation:e.unref(z),onToggleFullscreen:Pe,onGeneratePdf:e.unref(Z),onGenerateCsv:ce,onGenerateImage:e.unref(ee),onToggleTable:de,onToggleSort:fe,onToggleTooltip:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(Y)?e.unref(I)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:r})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.unref(t).style.chart.legend.show&&e.unref(t).style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:4,ref_key:"chartLegend",ref:F},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_top_${e.unref(M)}`,legendSet:e.unref(_),config:e.unref(re),onClickMarker:a[0]||(a[0]=({legend:n})=>V(n.id))},{item:e.withCtx(({legend:n,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:f=>V(n.id),style:e.normalizeStyle(`opacity:${e.unref(v).includes(n.id)?.5:1}`)},e.toDisplayString(n.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(e.unref(t).style.chart.layout.bars.dataLabels.value.formatter,n.value,e.unref(o.dataLabel)({p:e.unref(t).style.chart.legend.prefix,v:n.value,s:e.unref(t).style.chart.legend.suffix,r:e.unref(t).style.chart.legend.roundingValue}),{datapoint:n,seriesIndex:r})),13,Ue)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":e.unref(S),"vue-data-ui-fulscreen--off":!e.unref(S)}),viewBox:`0 0 ${e.unref(i).width<=0?10:e.unref(i).width} ${e.unref(u).fullHeight<=0?10:e.unref(u).fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${e.unref(t).style.chart.color}`)},[e.createVNode(Ie._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:e.unref(i).width<=0?10:e.unref(i).width,height:e.unref(u).fullHeight<=0?10:e.unref(u).fullHeight,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,je)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),(n,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${e.unref(C)}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":n.color},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(n.color,.03),100-e.unref(t).style.chart.layout.bars.gradientIntensity)},null,8,Ye)],8,Ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),(n,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(o.checkNaN)(e.unref($)?e.unref(u).left+e.unref(u).width/2-(n.sign===1?0:k(n.value)<=0?1e-4:k(n.value)):e.unref(u).left),y:e.unref(u).top+(e.unref(d)+e.unref(s))*r,width:e.unref(o.checkNaN)(k(n.value)<=0?1e-4:k(n.value)),height:e.unref(s)<=0?1e-4:e.unref(s),fill:e.unref(t).style.chart.layout.bars.underlayerColor,rx:e.unref(t).style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:e.unref(t).useCssAnimation})},null,10,Ke)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),(n,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(o.checkNaN)(e.unref($)?e.unref(u).left+e.unref(u).width/2-(n.sign===1?0:k(n.value)<=0?1e-4:k(n.value)):e.unref(u).left),y:e.unref(u).top+(e.unref(d)+e.unref(s))*r,width:e.unref(o.checkNaN)(k(n.value)<=0?1e-4:k(n.value)),height:e.unref(s)<=0?1e-4:e.unref(s),fill:e.unref(t).style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${e.unref(C)}_${r})`:e.unref(o.setOpacity)(n.color,e.unref(t).style.chart.layout.bars.fillOpacity),rx:e.unref(t).style.chart.layout.bars.borderRadius,stroke:e.unref(t).style.chart.layout.bars.useStroke?n.color:"none","stroke-width":e.unref(t).style.chart.layout.bars.useStroke?e.unref(t).style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:e.unref(t).useCssAnimation})},null,10,Je),(!n.isChild||n.isLastChild)&&e.unref(t).style.chart.layout.separators.show&&r!==e.unref(w).length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:e.unref(u).left,y1:e.unref(s)+e.unref(d)/2+e.unref(u).top+(e.unref(d)+e.unref(s))*r,y2:e.unref(s)+e.unref(d)/2+e.unref(u).top+(e.unref(d)+e.unref(s))*r,stroke:e.unref(t).style.chart.layout.separators.color,"stroke-width":e.unref(t).style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Qe)):e.createCommentVNode("",!0),e.unref($)&&e.unref(t).style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:e.unref(u).left+e.unref(u).width/2,x2:e.unref(u).left+e.unref(u).width/2,y1:e.unref(u).top,y2:e.unref(u).bottom,stroke:e.unref(t).style.chart.layout.separators.color,"stroke-width":e.unref(t).style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Ze)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:e.unref($)?e.unref(u).left+e.unref(u).width/2+(n.sign===1?-12:12)+(n.sign===1?-e.unref(t).style.chart.layout.bars.dataLabels.offsetX:e.unref(t).style.chart.layout.bars.dataLabels.offsetX):Be(n.value)+3+e.unref(t).style.chart.layout.bars.dataLabels.offsetX,y:e.unref(u).top+(e.unref(d)+e.unref(s))*r+e.unref(s)/2+e.unref(t).style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!e.unref($)||n.sign===-1?"start":"end","font-size":e.unref(t).style.chart.layout.bars.dataLabels.fontSize,fill:e.unref(t).style.chart.layout.bars.dataLabels.color,"font-weight":e.unref(t).style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(ie(n.value,n,r,n.sign)),9,et),(n.isChild||!n.hasChildren)&&e.unref(t).style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:e.unref(u).left-3+e.unref(t).style.chart.layout.bars.nameLabels.offsetX,y:e.unref(u).top+(e.unref(d)+e.unref(s))*r+e.unref(s)/2+e.unref(t).style.chart.layout.bars.nameLabels.fontSize/2,"font-size":e.unref(t).style.chart.layout.bars.nameLabels.fontSize,fill:e.unref(t).style.chart.layout.bars.nameLabels.color,"font-weight":e.unref(t).style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(n.name),9,tt)):e.createCommentVNode("",!0),n.isChild&&n.childIndex===0&&e.unref(t).style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+e.unref(t).style.chart.layout.bars.parentLabels.offsetX,y:T(n,r).y,"font-size":e.unref(t).style.chart.layout.bars.parentLabels.fontSize,fill:e.unref(t).style.chart.layout.bars.parentLabels.color,"font-weight":e.unref(t).style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(T(n,r).name),9,lt)):e.createCommentVNode("",!0),n.isChild&&n.childIndex===0&&e.unref(t).style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+e.unref(t).style.chart.layout.bars.parentLabels.offsetX,y:T(n,r).y+e.unref(t).style.chart.layout.bars.parentLabels.fontSize+6,"font-size":e.unref(t).style.chart.layout.bars.parentLabels.fontSize,fill:e.unref(t).style.chart.layout.bars.parentLabels.color,"font-weight":e.unref(t).style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(ie(T(n,r).value),T(n,r),r,n.parentSign||n.sign),9,nt)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:e.unref(u).top+(e.unref(d)+e.unref(s))*r-e.unref(d)/2,width:e.unref(i).width<=0?1e-4:e.unref(i).width,height:e.unref(s)+e.unref(d)<=0?1e-4:e.unref(s)+e.unref(d),fill:e.unref(A)===n.id?e.unref(o.setOpacity)(e.unref(t).style.chart.layout.highlighter.color,e.unref(t).style.chart.layout.highlighter.opacity):"transparent",onMouseenter:f=>Le(n,r),onMouseleave:a[1]||(a[1]=f=>{xe.value=null,D.value=!1,A.value=null})},null,40,at)]))),256)),e.renderSlot(l.$slots,"svg",{svg:e.unref(i)},void 0,!0)],14,Xe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(J)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),e.unref(B)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:7,config:{type:"verticalBar",style:{backgroundColor:e.unref(t).style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.unref(t).style.chart.legend.show&&e.unref(t).style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"chartLegend",ref:F},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_bottom_${e.unref(M)}`,legendSet:e.unref(_),config:e.unref(re),onClickMarker:a[2]||(a[2]=({legend:n})=>V(n.id))},{item:e.withCtx(({legend:n,index:r})=>[e.createElementVNode("div",{onClick:f=>V(n.id),style:e.normalizeStyle(`opacity:${e.unref(v).includes(n.id)?.5:1}`)},e.toDisplayString(n.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(e.unref(t).style.chart.layout.bars.dataLabels.value.formatter,n.value,e.unref(o.dataLabel)({p:e.unref(t).style.chart.legend.prefix,v:n.value,s:e.unref(t).style.chart.legend.suffix,r:e.unref(t).style.chart.legend.roundingValue}),{datapoint:n,seriesIndex:r})),13,rt)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:e.unref(_)},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:X,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(De._sfc_main,{show:e.unref(p).showTooltip&&e.unref(D)&&e.unref(v).length<y.dataset.length,backgroundColor:e.unref(t).style.chart.tooltip.backgroundColor,color:e.unref(t).style.chart.tooltip.color,borderRadius:e.unref(t).style.chart.tooltip.borderRadius,borderColor:e.unref(t).style.chart.tooltip.borderColor,borderWidth:e.unref(t).style.chart.tooltip.borderWidth,fontSize:e.unref(t).style.chart.tooltip.fontSize,backgroundOpacity:e.unref(t).style.chart.tooltip.backgroundOpacity,position:e.unref(t).style.chart.tooltip.position,offsetY:e.unref(t).style.chart.tooltip.offsetY,parent:e.unref(N),content:e.unref(O),isFullscreen:e.unref(S),isCustom:e.unref(t).style.chart.tooltip.customFormat&&typeof e.unref(t).style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...e.unref(R)})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...e.unref(R)})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.unref(B)?(e.openBlock(),e.createBlock(Me.default,{key:10,hideDetails:"",config:{open:e.unref(p).showTable,maxHeight:1e4,body:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color},head:{backgroundColor:e.unref(t).style.chart.backgroundColor,color:e.unref(t).style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:le,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",ut,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${e.unref(t).table.th.backgroundColor};`),onClick:a[3]||(a[3]=n=>e.unref(p).showTable=!1),onKeypress:a[4]||(a[4]=e.withKeys(n=>e.unref(p).showTable=!1,["enter"]))},[e.createVNode(Fe.default,{name:"close",stroke:e.unref(t).table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":e.unref(ne)})},[e.createElementVNode("table",st,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:e.unref(t).table.th.backgroundColor,color:e.unref(t).table.th.color,outline:e.unref(t).table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(e.unref(t).style.chart.title.text)+" ",1),e.unref(t).style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(e.unref(t).style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g).head,n=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${e.unref(t).table.th.outline}`)},[e.createElementVNode("div",ct,e.toDisplayString(n),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(e.unref(t).table.td.prefix)+e.toDisplayString(isNaN(e.unref(b))?"":e.unref(b).toFixed(e.unref(t).table.td.roundingValue))+e.toDisplayString(e.unref(t).table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${e.unref(t).table.th.backgroundColor};color:${e.unref(t).table.th.color};outline:${e.unref(t).table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g).body,(n,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${e.unref(t).table.td.backgroundColor};color:${e.unref(t).table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":e.unref(g).head[0]??""},[e.createElementVNode("div",ft,[n.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${n.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.parentName),1)])],12,dt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[1]??""},[e.createElementVNode("div",pt,e.toDisplayString(e.unref(t).table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(n.parentValue)?"":n.parentValue.toFixed(e.unref(t).table.td.roundingValue))+e.toDisplayString(e.unref(t).table.td.suffix),1)],12,ht),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[2]??""},[e.createElementVNode("div",gt,e.toDisplayString(["",NaN,void 0].includes(n.percentageToTotal)?"":`${(n.percentageToTotal*100).toFixed(e.unref(t).table.td.roundingPercentage)}%`),1)],12,yt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[3]??""},[e.createElementVNode("div",bt,e.toDisplayString(n.childName),1)],12,vt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[4]??""},[e.createElementVNode("div",kt,e.toDisplayString(e.unref(t).table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(n.childValue)?"":n.childValue.toFixed(e.unref(t).table.td.roundingValue))+e.toDisplayString(e.unref(t).table.td.suffix),1)],12,mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[5]??""},[e.createElementVNode("div",_t,e.toDisplayString(["",NaN,void 0].includes(n.childPercentageToParent)?"":`${(n.childPercentageToParent*100).toFixed(e.unref(t).table.td.roundingPercentage)}%`),1)],12,Ct),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${e.unref(t).table.td.outline}`),"data-cell":e.unref(g).head[6]??""},[e.createElementVNode("div",Nt,e.toDisplayString(["",NaN,void 0].includes(n.childPercentageToTotal)?"":`${(n.childPercentageToTotal*100).toFixed(e.unref(t).table.td.roundingPercentage)}%`),1)],12,xt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,He))}},$t=qe._export_sfc(wt,[["__scopeId","data-v-2d5dac5b"]]);exports.default=$t;