@mozaic-ds/chart 0.1.0-beta.27 → 0.1.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mozaic-chart.js
CHANGED
|
@@ -10316,7 +10316,7 @@ function gu() {
|
|
|
10316
10316
|
d,
|
|
10317
10317
|
"column"
|
|
10318
10318
|
);
|
|
10319
|
-
for (y.style.display = "flex", y.style.margin = "1.375rem 1.0625rem", y.style.flexDirection = "row-reverse", y.style.justifyContent = "flex-end"; y.firstChild; )
|
|
10319
|
+
for (y.style.display = "flex", y.style.margin = "1.375rem 1.0625rem", y.style.flexDirection = "row-reverse", y.style.flexWrap = "wrap", y.style.justifyContent = "flex-end"; y.firstChild; )
|
|
10320
10320
|
y.firstChild.remove();
|
|
10321
10321
|
p.options.plugins.legend.labels.generateLabels(p).sort((_, v) => v.datasetIndex - _.datasetIndex).forEach((_) => {
|
|
10322
10322
|
const v = Ri(
|
|
@@ -10340,7 +10340,7 @@ function gu() {
|
|
|
10340
10340
|
g.value,
|
|
10341
10341
|
b.value,
|
|
10342
10342
|
!1
|
|
10343
|
-
), w.style.boxSizing = "border-box", v.style.marginRight = "10px", v.appendChild(w), v.appendChild(Fi(_)), y.appendChild(v);
|
|
10343
|
+
), w.style.boxSizing = "border-box", v.style.marginRight = "10px", v.style.marginBottom = "2px", v.appendChild(w), v.appendChild(Fi(_)), y.appendChild(v);
|
|
10344
10344
|
});
|
|
10345
10345
|
}
|
|
10346
10346
|
}
|
|
@@ -19,7 +19,7 @@ var Au=Object.defineProperty;var Du=(G,x,rt)=>x in G?Au(G,x,{enumerable:!0,confi
|
|
|
19
19
|
min-width: ${yi};
|
|
20
20
|
min-height: ${yi};
|
|
21
21
|
margin-right: ${Uo};
|
|
22
|
-
border-color: ${o};`)}function Sn(i,t,e){const s=i.config.type==="doughnut"?t.index:t.datasetIndex,o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("data-test-id",`legend-checkbox-${s}`);const a=Qo(i,s),r=e?e[s]:void 0;return Sd(a,t,o,r),o}function wn(i){const{type:t}=i.config;return t==="pie"||t==="doughnut"}function Zo(i){let t=i.config.data.datasets;return wn(i)&&(t=i.config.data.datasets[0].data),t}function Jo(i,t,e){if(!e.value){const n=Zo(i);e.value=!0,n.forEach((s,o)=>{o!==t&&vi(i,o)})}}function wd(i){let t=!0;return Zo(i).forEach((n,s)=>{t=t&&Qo(i,s)}),t}function Qo(i,t){return wn(i)?i.getDataVisibility(t):i.isDatasetVisible(t)}function vi(i,t,e){wn(i)?i.toggleDataVisibility(t):i.setDatasetVisibility(t,!i.isDatasetVisible(t)),e&&wd(i)&&(e.value=!1),i.update()}function kn(i,t){const e=Ko(i,""),n=vd(i),s=i.index||i.datasetIndex;return n.style.width="10px",n.style.height="10px",s%2===0?t?n.style.borderRadius="25px":n.style.transform="rotate(45deg)":t?n.style.transform="rotate(45deg)":n.style.borderRadius="25px",e.appendChild(n),e}function Si(i,t){var n,s;let e=(n=i.value)==null?void 0:n.querySelector("ul");return e||(e=document.createElement("ul"),e.style.display="flex",e.style.flexDirection=t,e.style.margin="0",e.style.padding="0",(s=i.value)==null||s.appendChild(e)),e}function ta(i){return i==="#00000000"}function Oe(i,t){const e=Math.round(Math.min(Math.max(t||1,0),1)*255);return i+e.toString(16).toUpperCase()}const{getPatternIndexWithShift:Cn}=bi();function kd(){const i=x.ref(3),t=x.ref(null),e=x.reactive({dataSetIndex:-1,columnIndex:-1});function n(g,b,p,y,_,v){return Xo(g,b,e,p,y,_,v)}function s(){i.value=4,i.value=3}function o(g,b,p,y,_,v){const S=i.value;return g.map((k,M)=>({borderColor:function(w){return p?"#00000000":r(M,w.index,y,v)},backgroundColor:function(w){return l(M,w.index,p,y,_,v)},borderWidth:function(){return p?1:S},data:k.data,label:k.label,stack:`Stack ${b?k.stack:M}`}))}function a(g,b,p,y,_){return o([g,b],!1,_,p,y)}function r(g,b,p,y){const _=Cn(g,y);return u(g,b)?p[_]:Oe(p[_],.2)}function l(g,b,p,y,_,v){const S=Cn(g,v);return u(g,b)?_[S](!1,y[S],p):_[S](!0,y[S],p)}function c(){return e.dataSetIndex<0}function h(g,b){return e.dataSetIndex===g&&e.columnIndex===b}function d(g){return e.dataSetIndex===g&&e.columnIndex<0}function u(g,b){return c()||h(g,b)||d(g)}function f(){e.dataSetIndex=-1,e.columnIndex=-1}function m(){return(g,b)=>{b[0]!==void 0?(e.dataSetIndex=b[0].datasetIndex,e.columnIndex=b[0].index):f()}}return{onHoverIndex:e,reloadChart:s,getDatasets:a,getStackedDatasets:o,getOnHoverOptions:m,getBorderColor:r,getPattern:l,privateGetHtmlLegendPlugin:n,getPatternIndexWithShift:Cn,barChartRef:t,borderWidth:i}}const{getPatternCanvas:Cd}=bi();class se{constructor(){C(this,"chartType","");C(this,"datasetIndex",0);C(this,"dataIndex",0);C(this,"titleLines",[""]);C(this,"dataToDisplay","");C(this,"xValue","");C(this,"yValue","");C(this,"patternShifting",0)}createTooltip(t,e,n,s,o,a=!1){var c,h,d,u;if(!t.tooltip.dataPoints)return;this.datasetIndex=((c=t.tooltip)==null?void 0:c.dataPoints[0].datasetIndex)||0,this.dataIndex=t.tooltip.dataPoints[0].dataIndex||0,this.xValue=n.firstLineLabel||"",this.yValue=n.secondLineLabel||"",this.chartType=n.chartType,this.dataToDisplay=e(t),this.patternShifting=n.patternShifting||0;let r=document.querySelector("#chartjs-tooltip");r||(r=this.createNewTooltipElement());const l=t.tooltip;if(l.opacity===0){r.style.opacity="0";return}if(l.body){this.titleLines=l.title||[];const f=l.body.map(this.getBody);let m="background: white;";m+="border-bottom: 1px solid #CCCCCC;",m+="border-radius: 5px;",m+="padding: 10px 20px";const g=`<div style="${m}" class="tooltipTitle">`,b=this.chartType==="DOUGHNUT"?[l.title[0].split("(")[0].trim()]:f[0];let p="",y="";const _=(u=(d=(h=t.tooltip)==null?void 0:h.dataPoints[0])==null?void 0:d.dataset)==null?void 0:u.type;this.chartType==="RADAR"||this.chartType==="LINE_CHART"?(p=this.createLegendStyle(t),y=this.createLegendInnerStyle(t)):this.chartType==="BAR_CHART"||this.chartType==="DETAILS_BAR_CHART"||this.chartType==="DOUGHNUT"?p=this.createPatternLegendStyle(t):this.chartType==="MIXED_BAR_LINE_CHART"&&(_==="bar"?p=this.createPatternLegendStyle(t):(p=this.createLegendStyle(t),y=this.createLegendInnerStyle(t))),this.addLegendToDom(g,p,y,b,m,r,s,o,a,_)}this.handleTooltipPosition(t,l,r)}handleTooltipPosition(t,e,n){const s=t.chart.canvas.getBoundingClientRect(),o=window.innerWidth,a=s.left+window.pageXOffset+e.caretX,r=s.top+window.pageYOffset+e.caretY;n.style.left=a+"px",n.style.top=r+"px",n.style.height="auto",n.style.minWidth="17rem",n.style.opacity="1",n.style.position="absolute",n.style.zIndex="99",n.style.backgroundColor="white",n.style.pointerEvents="none",n.getBoundingClientRect().width+a>o&&(n.style.left=a-n.getBoundingClientRect().width+"px")}createNewTooltipElement(){const t=document.createElement("div");return t.id="chartjs-tooltip",t.style.backgroundColor="white",t.style.borderRadius="5px",t.style.transition="opacity .5s",t.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",t.innerHTML='<div class="tooltipCtn"></div>',document.body.appendChild(t),t}createPatternLegendStyle(t){return this.createCommonLegendSquareStyle(t)}createLegendStyle(t){let e=`background-color:${t.tooltip.labelColors[0].backgroundColor}`;return e+=this.createCommonLegendSquareStyle(t),e}createCommonLegendSquareStyle(t){let e=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor}`;return e+=";min-height: 20px",e+=";min-width: 20px",e+=";border-radius: 5px",e+=";margin-right: 10px",e+=";display: flex",e+=";align-items: center",e+=";justify-content: center",e+=";background: rgba(0, 0, 0, 0.1);",e}createLegendInnerStyle(t){let e="height: 12px";return e+=";width: 12px",e+=";background-color: #FFF",e+=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor};`,t.tooltip.labelPointStyles[0].pointStyle==="circle"?e+="border-radius: 25px;":t.tooltip.labelPointStyles[0].pointStyle==="rectRot"&&(e+="transform: rotate(45deg);"),e}addLegendToDom(t,e,n,s,o,a,r,l,c=!1,h){let d=t,u=`<div class="legendIcon" style="${e}">`;const f=`<div style="${n}"></div>`;u+=`${f}</div>`;const m=this.setInnerHtmlToAdd(s,o,u);d+=m;const g=a==null?void 0:a.querySelector(".tooltipCtn");(g==null?void 0:g.innerHTML)!=null&&(h?this.setInnerHtmlAndPattern(g,d,r,l,c,h):this.setInnerHtmlAndPattern(g,d,r,l,c))}setInnerHtmlToAdd(t,e,n){const a=`<span style="font-family: Arial; font-size: 16px">${t[0].split(":")[0]}</span>`;return this.chartType==="RADAR"?this.returnRadarHtml(e,n,a):this.chartType==="DOUGHNUT"?this.returnDoughnutHtml(n,a):this.returnDetailsBarchartHtml(e,n,a)}returnDoughnutHtml(t,e){const n="font-family: Arial; font-size: 16px",s=`<span style="${n}">${e.split("(")[0]}</span>`;let o=`<div style="${n}; display: flex; align-items: center; justify-content: space-between">`;return o+=`<div style="display:flex; align-items: center;" >${t+s}</div>`,o+=`<div style="${n}; margin-left:3rem;">${this.dataToDisplay}</div>`,o+="</div></div>",o}returnRadarHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; border: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.titleLines[0]}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o+="</div><div>",o}returnDetailsBarchartHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; display:flex; justify-content: space-between;">`,o+=`<div>${this.xValue}</div>`,o+=`<div style="margin-left: 20px;">${this.titleLines[0]}</div>`,o+="</div>",o+=`<div style="${s}; ${t}; border-: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.yValue}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o}setInnerHtmlAndPattern(t,e,n,s,o=!1,a){t.innerHTML=e;const r=document.querySelector(".legendIcon"),l=new Image;let c;this.chartType==="DOUGHNUT"?c=this.dataIndex+1:c=this.datasetIndex+1;const h=ud(c,this.patternShifting);if(this.chartType!=="LINE_CHART"&&this.chartType!=="RADAR"&&a!=="line"){const d=s[h-1](!1,n[h-1],o),u=Cd(d,22,22);l.src=u.toDataURL(),r.style.backgroundImage=`url(${l.src})`}}getBody(t){return t.lines}}var oe=(i=>(i.RADAR="RADAR",i.BAR_CHART="BAR_CHART",i.MIXED_BAR_LINE_CHART="MIXED_BAR_LINE_CHART",i.DETAILS_BAR_CHART="DETAILS_BAR_CHART",i.LINE_CHART="LINE_CHART",i.DOUGHNUT="DOUGHNUT",i))(oe||{});function Md(i,t="#A274FF",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.5*o,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.75*o,o/2,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.25*o,o/2,a,a),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c||new CanvasPattern}function Pd(i,t="#143666",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(-o*.03,-.01*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.29*o,.33*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.63*o,.69*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.33*o,-.37*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.71*o,-.72*o,o+o/2,.04*o),s.fill(),s.restore()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Ad(i,t="#00A3B2",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o/2),s.lineTo(0,0),s.lineTo(o/2,o/2),s.lineTo(o,0),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o),s.lineTo(0,o/2),s.lineTo(o/2,o),s.lineTo(o,o/2),s.lineTo(o+o/2,o),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,111e-6),s.lineTo(4e-6*o,-o/2),s.lineTo(o/2,111e-6),s.lineTo(o,-o/2),s.lineTo(o+o/2,111e-6),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o+o/2),s.lineTo(0,o),s.lineTo(o/2,o+o/2),s.lineTo(o,o),s.lineTo(o+o/2,o+o/2),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Dd(i,t="#8C1551",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,a,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.005*o,s.rect(o/2,0,a,o),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,o,o),c):new CanvasPattern}function Ld(i,t="#F255A3",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=new DOMMatrix,a=21,r=.1*a;n.width=a,n.height=a,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,a,a),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=r,s.moveTo(r,0),s.lineTo(r,.5*a),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=r,s.moveTo(a/2+r,0),s.lineTo(a/2+r,.5*a),s.stroke()),i&&(s.beginPath(),s.fillStyle="#FFFFFF",s.globalAlpha=.5,s.lineWidth=.006*a,s.rect(0,0,a,a),s.fill());const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return new CanvasPattern;const h=c.createPattern(n,"repeat");return h?(c.fillStyle=h,c.fillRect(0,0,l.width,l.height),h.setTransform(o.rotate(45)),h):new CanvasPattern}function Td(i,t="#095359",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=.04*o;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.06*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.56*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.44*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.94*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas"),l=r.getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,r.width,r.height),c):new CanvasPattern}function ae(){return{patternsStandardList:[Md,Pd,Ad,Dd,Ld,Td],colourSets:[["#393879","#006974","#405D68","#005C91","#8C3500","#8C0003"],["#A274FF","#143666","#00A3B2","#8C1551","#F255A3","#095359"],["#00A3B2","#143666","#3D993D","#8C1551","#E56D17","#4C3380"],["#8C1551","#E56D17","#4C3380","#4588E5","#095359","#F255A3"],["#4588E5","#4C3380","#E56D17","#143666","#D94141","#8C1551"],["#143666","#F255A3","#095359","#4588E5","#8C1551","#E56D17"],["#A274FF","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0"]]}}const Od={class:"container"},Id={class:"main"},Fd=x.defineComponent({__name:"BarChart",props:{chartId:{type:String,default:"radar-chart"},unit:{type:String,default:"%"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==n.length?e[t.colourSet]:t.newPatternsOrder.map(P=>e[t.colourSet][P])),r=x.computed(()=>t.newPatternsOrder.length!==n.length?n:t.newPatternsOrder.map(P=>n[P])),l=x.computed(()=>t.disableAccessibility),c=x.computed(()=>t.enableHoverFeature),{onHoverIndex:h,barChartRef:d,reloadChart:u,getOnHoverOptions:f,getStackedDatasets:m,privateGetHtmlLegendPlugin:g}=kd(),b=x.computed(()=>{const P=M(v.value);return _(),{labels:P,datasets:m(t.datasets.map((A,L)=>({data:S(L,v.value),label:t.datasets[L].label,stack:A.stack||0})),t.stacked,t.disableAccessibility,a.value,r.value,0)}});let p,y;const _=()=>{p=t.tooltipFirstLineLabel,y=t.tooltipSecondLineLabel},v=x.computed(()=>{const P=t.labels;if(P.includes("other")){const A=P.indexOf("other");if(t.datasets[0].data[A].rate+""=="0"&&t.datasets[1].data[A].rate+""=="0")return A}return null}),S=(P,A,L=!1)=>{const V=Object.assign([],t.datasets[P].data);return A&&v.value&&V.splice(v.value,1),V.map(U=>t.unit==="%"?U.rate:U.amount)},k=P=>{const A=P.tooltip.dataPoints[0].datasetIndex,L=P.tooltip.dataPoints[0].dataIndex,V=P.tooltip.body[0].lines[0].split(":")[1],U=t.datasets[A].data[L],F=U.rate?parseFloat(V.replace(",",".")).toFixed(2)+"% ":"",B=U.amountUnit?U.amountUnit:"",j=U.amount?tt(U.amount):"";return F+(F&&j?"/ ":"")+j+B},M=P=>{const A=Object.assign([],t.labels);return P&&A.splice(P,1),A.map(L=>L)},w=x.computed(()=>({onHover:t.enableHoverFeature?f():()=>{},elements:{bar:{borderSkipped:!1}},maxBarThickness:64,categoryPercentage:.6,plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(P){var L;const A=((L=P.tooltip.dataPoints)==null?void 0:L[0].dataIndex)||0;!t.labels[A]||t.labels[A]===""||new se().createTooltip(P,k,{chartType:oe.BAR_CHART,firstLineLabel:p,secondLineLabel:y},a.value,r.value,t.disableAccessibility)}}},scales:{x:{stacked:t.stacked,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{stacked:t.stacked,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},ticks:{callback:function(P){return t.unit==="%"?_n(P,t.unit):tt(P)+" "+t.unit}}}}})),D=x.computed(()=>g(s,o,l,a,r,c));return x.watch(h,()=>{u()},{deep:!0}),(P,A)=>(x.openBlock(),x.createElementBlock("div",Od,[x.createElementVNode("div",Id,[b.value?(x.openBlock(),x.createBlock(x.unref($o),{key:0,ref_key:"barChartRef",ref:d,id:i.chartId,data:b.value,options:w.value,plugins:D.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Lu="",Tu="",re=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},wi=re(Fd,[["__scopeId","data-v-aaa6e255"]]);wi.install=i=>{i.component("BarChart",wi)};function Rd(){const i=x.ref(null),t=x.ref(null),e=x.ref(null);function n(h,d,u,f,m,g,b,p){return Xo(h,d,t,u,f,m,p,g,b)}function s(h,d,u,f){return t.value!==null&&f?d.map((m,g)=>t.value===g?m(!1,h[g],u):m(!0,h[g],u)):d.map((m,g)=>m(!1,h[g],u))}function o(h,d){return t.value!==null&&d?h.map((u,f)=>t.value===f?u:Oe(u,.2)):h}function a(){return(h,d)=>{d[0]!==void 0?t.value=d[0].element.$context.index:t.value=null}}const r=h=>h.charAt(0).toUpperCase()+h.slice(1).toLowerCase();function l(h,d,u,f){let m=h.slice(0),g=d.slice(0);return h.length>u&&(g=c(d,u),m=m.slice(0,u-1),m.push(f)),m.map((b,p)=>`${r(b)} (${tt(g[p].rate)} %)`)}function c(h,d){if(d<1)return h;let u=h.slice(0);return h.length>d&&(u=u.slice(0,d),u[d-1]=h.slice(d).reduce((f,m)=>(f.rate+=m.rate,f.value+=m.value,f),{rate:h[d-1].rate,value:h[d-1].value})),u}return{onHoverIndex:t,privateGetHtmlLegendPlugin:n,getOnHoverOptions:a,groupDataAfterNthValue:c,getDoughnutLabels:l,getBackgroundColor:s,getFormatedText:r,getBorderColor:o,backgroundColor:e,doughnutRef:i}}const Ed={class:"container"},Bd={class:"main"},zd=x.defineComponent({__name:"DoughnutChart",props:{chartId:{type:String,default:"doughnut-chart"},data:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]},cssClasses:{type:String,default:void 0},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},width:{type:String,default:"400px"},height:{type:String,default:"400px"},maxValues:{type:Number,default:5},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},othersLabel:{type:String,default:"others"}},setup(i){const t=i;wt.register(Qt,te,Jt,Kt);const{colourSets:e,patternsStandardList:n}=ae(),{onHoverIndex:s,doughnutRef:o,getBackgroundColor:a,privateGetHtmlLegendPlugin:r,getOnHoverOptions:l,groupDataAfterNthValue:c,getDoughnutLabels:h,getBorderColor:d}=Rd(),u=x.ref(!1),f=x.ref(null),m=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(w=>e[t.colourSet][w])),g=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(w=>n[w])),b=x.computed(()=>({labels:h(t.labels,t.data,t.maxValues,t.othersLabel),datasets:[{data:c(t.data,t.maxValues).map(w=>w.rate),backgroundColor:a(m.value,g.value,t.disableAccessibility,t.enableHoverFeature),borderColor:d(m.value,t.enableHoverFeature)}]})),p=w=>{const D=w.tooltip.dataPoints[0].dataIndex,P=c(t.data,t.maxValues)[D],A=tt(P.rate),L=tt(P.value),V=P.unit||"";return`${L}${V} (${A})%`};function y(){return t.labels.length<=1?0:12}const _=x.computed(()=>{const w=m.value,D=g.value;return{onHover:t.enableHoverFeature?l():()=>{},plugins:{legend:{display:!1,position:"bottom",align:"start",labels:{pointStyle:"rectRounded",usePointStyle:!0}},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(P){new se().createTooltip(P,p,{chartType:oe.DOUGHNUT},w,D,S.value)}}},radius:"90%",cutout:"70%",borderWidth:3,spacing:y(),hoverOffset:4}}),v={data:t.data,labels:t.labels},S=x.computed(()=>t.disableAccessibility),k=x.computed(()=>t.enableHoverFeature),M=x.computed(()=>r(f,u,S,m,g,t.maxValues,v,k));return x.onMounted(()=>{a(m.value,g.value,t.disableAccessibility,k.value)}),x.watch(s,(w,D)=>{w!==D&&k.value&&a(m.value,g.value,t.disableAccessibility,k.value)}),x.watch(S,()=>{a(m.value,g.value,t.disableAccessibility,k.value)}),(w,D)=>(x.openBlock(),x.createElementBlock("div",Ed,[x.createElementVNode("div",Bd,[b.value?(x.openBlock(),x.createBlock(x.unref(ld),{key:0,ref_key:"doughnutRef",ref:o,id:i.chartId,data:b.value,options:_.value,plugins:M.value,"max-values":i.maxValues,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","max-values","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:f},null,512)]))}}),Ou="",ki=re(zd,[["__scopeId","data-v-b0907849"]]);ki.install=i=>{i.component("DoughnutChart",ki)};const Wd={class:"container"},Hd={class:"main"},Nd=x.defineComponent({__name:"LineChart",props:{chartId:{type:String,default:"radar-chart"},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},width:{type:String,default:"200px"},height:{type:String,default:"400px"},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},lines:{type:Array,default:()=>{}},labels:{type:Array,default:()=>[]},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},suggestedMin:{type:Number,default:void 0},suggestedMax:{type:Number,default:void 0},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,pt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(p=>e[t.colourSet][p])),r=t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(p=>n[p]),l=p=>{const y=p.tooltip.dataPoints[0].datasetIndex,_=p.tooltip.dataPoints[0].dataIndex,v=t.lines[y].data[_].toFixed(2);return t.lines[y].unit?v+" "+t.lines[y].unit:v},c=x.computed(()=>t.tooltipFirstLineLabel),h=x.computed(()=>t.tooltipSecondLineLabel),d=p=>{switch(p){case 1:return"circle";default:return"rectRot"}},u=x.computed(()=>({labels:t.labels.map(p=>p),datasets:t.lines.map((p,y)=>({type:"line",borderColor:a.value[y],pointStyle:d(y),pointBackgroundColor:"#FFFFFF",pointRadius:5,label:p.label,data:p.data,borderWidth:2}))}));function f(p,y){return[{id:"htmlLegend",afterUpdate(_){const v=Si(p,"column");for(v.style.display="flex",v.style.flexDirection="row",v.style.margin="1.375rem 1.0625rem";v.firstChild;)v.firstChild.remove();_.options.plugins.legend.labels.generateLabels(_).forEach(k=>{const M=_i(_,y,k.datasetIndex);let w;y.value?w=m(_,k):w=kn(k),w.style.boxSizing="border-box",M.style.marginRight="10px",M.appendChild(w),M.appendChild(xi(k)),v.appendChild(M)})}}]}function m(p,y){const _=Sn(p,y,null);return _.onclick=v=>{vi(p,y.datasetIndex,o),v.stopPropagation()},_}const g=f(s,o),b=x.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(p){new se().createTooltip(p,l,{chartType:oe.LINE_CHART,firstLineLabel:c.value,secondLineLabel:h.value},a.value,r,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{type:"linear",display:!0,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},suggestedMin:t.suggestedMin,suggestedMax:t.suggestedMax,position:"left",grid:{drawOnChartArea:!0},ticks:{callback:function(p){const y=t.lines[0].unit;return`${tt(p)} ${y||""}`}}}}}));return(p,y)=>(x.openBlock(),x.createElementBlock("div",Wd,[x.createElementVNode("div",Hd,[u.value?(x.openBlock(),x.createBlock(x.unref(cd),{key:0,ref:"lineChartRef",id:i.chartId,data:u.value,options:b.value,plugins:x.unref(g),class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Iu="",Ci=re(Nd,[["__scopeId","data-v-8e74b12a"]]);Ci.install=i=>{i.component("LineChart",Ci)};function Vd(i,t){const e=i.ctx,n=i.scales.r,s=i.data.labels;!e||!n||!s||(e.save(),s.forEach((o,a)=>{const r=(n.getIndexAngle(a)-Math.PI/2)%(2*Math.PI),l=n.getPointPositionForValue(a,n.max);e.textAlign=r<=Math.PI/2||r>3*Math.PI/2?"left":"right";let c=r<=Math.PI/2||r>3*Math.PI/2?15:-15,h;r<0||r>Math.PI?h=-15:h=15,r>Math.PI/4&&r<3*Math.PI/4&&(h*=3),(r<-Math.PI/4||r>5*Math.PI/4)&&(h*=3,c=0),(r>11*Math.PI/8||r<-3*Math.PI/8)&&(e.textAlign="center");const d=l.y+h*(o.length-1)/2;e.font="12px Arial",o.forEach((u,f)=>{const m=f===o.length-1?jd(t)[a]:"#000000";e.fillStyle=m;const g=l.x+c,b=d+15*f;e.fillText(u,g,b)})}),e.restore())}const jd=i=>i.datasets[0].areaData.map(t=>{switch(t.color){case"red":return"#C61112";case"green":return"#46A610";default:return"#000000"}});function $d(i,t){if(i.length>7&&i.includes(" ",7)){const n=i.indexOf(" ",7);return[i.substring(0,n),i.substring(n),t]}return[i,t]}const Ud={class:"container"},Yd=x.defineComponent({__name:"RadarChart",props:{chartId:{type:String,default:"radar-chart"},height:{type:String,default:"600px"},labels:{type:Array,default:()=>[]},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Le,pt,Tt,Sh);const{colourSets:e,patternsStandardList:n}=ae(),s=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(b=>e[t.colourSet][b])),o=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(b=>n[b])),a=x.computed(()=>({labels:d(),datasets:r()}));function r(){return t.datasets.map((b,p)=>({label:b.label,backgroundColor:Oe(s.value[p],.1),borderColor:s.value[p],pointBackgroundColor:"#FFFFFF",pointBorderColor:s.value[p],pointBorderWidth:2,borderWidth:2,pointHitRadius:55,pointRadius:5,pointStyle:p%2===0?"circle":"rectRot",pointHoverBackgroundColor:s.value[p],pointHoverBorderColor:s.value[p],data:b.areaData.map(y=>y.position)}))}const l={onClick:(b,p,y)=>{p[0]&&Jo(y,p[0].datasetIndex,h)},plugins:{htmlLegend:{containerID:"legend-container"},legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(b){new se().createTooltip(b,g,{chartType:oe.RADAR},s.value,o.value,t.disableAccessibility)}}},layout:{padding:{left:130,right:95,top:95,bottom:95}},scales:{r:{min:0,max:100,pointLabels:{display:!1,font:{weight:400,family:"Roboto"}},ticks:{display:!1,stepSize:25}}}},c=x.ref(null),h=x.ref(!1),d=()=>t.labels.map((b,p)=>{const y=t.datasets[0].areaData[p].value?`${u(t.datasets[0].areaData[p].value+"")} ${t.datasets[0].areaData[p].unit}`:"No Data";return $d(b,y)}),u=b=>tt(parseFloat(b));function f(b,p){const y=Sn(b,p,null);return y.onclick=_=>{vi(b,p.datasetIndex,h),_.stopPropagation()},y}const m=[{id:"htmlLegend",afterUpdate(b){const p=Si(c,"row");for(;p.firstChild;)p.firstChild.remove();b.options.plugins.legend.labels.generateLabels(b).reverse().forEach(_=>{const v=_i(b,h,_.datasetIndex);let S;v.style.marginRight="0.625rem",h.value?S=f(b,_):S=kn(_,!0),v.appendChild(S),v.appendChild(xi(_)),p.appendChild(v)})}},{id:"radarLabelPlugin",beforeDraw(b){Vd(b,t)}}],g=b=>{const p=b.tooltip.dataPoints[0].datasetIndex,y=b.tooltip.dataPoints[0].dataIndex,_=t.datasets[p];return _.areaData[y].value.toFixed(2)+" "+_.areaData[y].unit};return(b,p)=>(x.openBlock(),x.createElementBlock("div",Ud,[x.createElementVNode("div",{class:"main",style:x.normalizeStyle({height:i.height})},[a.value?(x.openBlock(),x.createBlock(x.unref(hd),{key:0,id:i.chartId,data:a.value,options:l,plugins:m,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","class","style"])):x.createCommentVNode("",!0)],4),x.createElementVNode("div",{ref_key:"legendContainer",ref:c,class:"legendContainer"},null,512)]))}}),Fu="",Mi=re(Yd,[["__scopeId","data-v-00cff15e"]]);Mi.install=i=>{i.component("RadarChart",Mi)};const ea=Object.freeze(Object.defineProperty({__proto__:null,BarChart:wi,DoughnutChart:ki,LineChart:Ci,RadarChart:Mi},Symbol.toStringTag,{value:"Module"})),{getPatternIndexWithShift:ia}=bi();function Xd(){const i=x.ref(2),t=x.reactive({dataSetIndex:-1,columnIndex:-1});function e(d,u,f,m,g,b){return[{id:"htmlLegend",afterUpdate(p){const y=Si(d,"column");for(y.style.display="flex",y.style.margin="1.375rem 1.0625rem",y.style.flexDirection="row-reverse",y.style.justifyContent="flex-end";y.firstChild;)y.firstChild.remove();p.options.plugins.legend.labels.generateLabels(p).sort((v,S)=>S.datasetIndex-v.datasetIndex).forEach(v=>{const S=_i(p,u,v.datasetIndex);let k;u.value?k=qo(p,v,u,{datasetIndex:-1},g.value,!1):v!=null&&v.lineCap?k=kn(v):k=Go(v,p,{datasetIndex:-1},m.value,g.value,b.value,!1),k.style.boxSizing="border-box",S.style.marginRight="10px",S.appendChild(k),S.appendChild(xi(v)),y.appendChild(S)})}}]}function n(d,u,f,m,g){return e(d,u,t,f,m,g)}function s(d,u,f,m,g){const b=i.value;return d.map((p,y)=>{const _=p.type==="bar";return{type:p.type,fill:_?null:!1,borderWidth:function(){return u&&_?1:b},borderColor:function(v){return u&&_?"#00000000":_?o(y,v.index,f,g):f[y%f.length]},backgroundColor:function(v){return a(y,v.index,u,f,m,g)},yAxisID:_?"A":"B",pointStyle:y%2===0?"rectRot":"circle",data:p.data,label:p.label,pointBackgroundColor:"#FFFFFF",pointRadius:5,order:p.type==="line"?0:1}})}function o(d,u,f,m){const g=ia(d,m);return r(d,u)?f[g]:Oe(f[g],.2)}function a(d,u,f,m,g,b){const p=ia(d,b);return r(d,u)?g[p](!1,m[p],f):g[p](!0,m[p],f)}function r(d,u){return l()||c(d,u)||h(d)}function l(){return t.dataSetIndex<0}function c(d,u){return t.dataSetIndex===d&&t.columnIndex===u}function h(d){return t.dataSetIndex===d&&t.columnIndex<0}return{privateGetHtmlLegendPlugin:n,getMixedDatasets:s,getBorderColor:o,getPattern:a,onHoverIndex:t}}const Gd={class:"container"},qd={class:"main"},Kd=x.defineComponent({__name:"MixedBarLineChart",props:{chartId:{type:String,default:"mixed-bar-line-chart"},unit:{type:String,default:""},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},barDatasets:{type:Array,default:()=>[]},barUnit:{type:String,default:""},lineDatasets:{type:Array,default:()=>[]},lineUnit:{type:String,default:""},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},xAxisTitle:{type:String,default:null},yLeftAxisTitle:{type:String,default:null},yRightAxisTitle:{type:String,default:null}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie,pt,Tt);const{privateGetHtmlLegendPlugin:e,getMixedDatasets:n}=Xd(),{colourSets:s,patternsStandardList:o}=ae(),a=x.ref(null),r=x.ref(!1),l=x.computed(()=>{let p=[];return t.barDatasets&&(p=p.concat(t.barDatasets)),t.lineDatasets&&(p=p.concat(t.lineDatasets)),p}),c=x.computed(()=>t.newPatternsOrder.length!==o.length?s[t.colourSet]:t.newPatternsOrder.map(p=>s[t.colourSet][p])),h=x.computed(()=>t.newPatternsOrder.length!==o.length?o:t.newPatternsOrder.map(p=>o[p])),d=x.computed(()=>t.disableAccessibility),u=x.computed(()=>({labels:m(),datasets:n(l.value,d.value,c.value,h.value,0)})),f=p=>{const y=p.tooltip.dataPoints[0].datasetIndex,_=p.tooltip.dataPoints[0].dataIndex,v=l.value[y].data[_],S=l.value[y].type==="bar"?t.barUnit:t.lineUnit;return(S==="%"?parseFloat(v.toString().replace(",",".")).toFixed(2):tt(v))+S},m=()=>Object.assign([],t.labels).map(y=>y),g=x.computed(()=>({type:"bar",responsive:!0,maintainAspectRatio:!0,maxBarThickness:64,categoryPercentage:.6,elements:{bar:{borderSkipped:!1}},plugins:{legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(p){new se().createTooltip(p,f,{chartType:oe.MIXED_BAR_LINE_CHART,firstLineLabel:t.tooltipFirstLineLabel,secondLineLabel:t.tooltipSecondLineLabel},c.value,h.value,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},A:{type:"linear",display:!0,position:"left",grid:{drawOnChartArea:!0},title:{display:t.yLeftAxisTitle!==null,text:t.yLeftAxisTitle},ticks:{callback:function(p){return t.barUnit==="%"?_n(p,t.unit):tt(p)+" "+t.barUnit}}},B:{type:"linear",display:!0,position:"right",grid:{drawOnChartArea:!1},title:{display:t.yRightAxisTitle!==null,text:t.yRightAxisTitle},ticks:{callback:function(p){return(t.lineUnit==="%"?_n(p,t.unit):tt(p))+" "+t.lineUnit}}}}})),b=x.ref(e(a,r,d,c,h));return(p,y)=>(x.openBlock(),x.createElementBlock("div",Gd,[x.createElementVNode("div",qd,[u.value?(x.openBlock(),x.createBlock(x.unref($o),{key:0,ref:"mixedBarLineChartRef",id:i.chartId,data:u.value,options:g.value,plugins:b.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:a},null,512)]))}}),Ru="",Eu="",Mn=re(Kd,[["__scopeId","data-v-6a9cb065"]]);Mn.install=i=>{i.component("MixedBarLineChart",Mn)};const Zd="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBmaWxsPSJub25lIj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNy41IiBzdHJva2U9IiM2NjY2NjYiLz4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iMTEuMiIgcj0iNC4zIiBzdHJva2U9IiM2NjY2NjYiLz4KPC9zdmc+";/*!
|
|
22
|
+
border-color: ${o};`)}function Sn(i,t,e){const s=i.config.type==="doughnut"?t.index:t.datasetIndex,o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("data-test-id",`legend-checkbox-${s}`);const a=Qo(i,s),r=e?e[s]:void 0;return Sd(a,t,o,r),o}function wn(i){const{type:t}=i.config;return t==="pie"||t==="doughnut"}function Zo(i){let t=i.config.data.datasets;return wn(i)&&(t=i.config.data.datasets[0].data),t}function Jo(i,t,e){if(!e.value){const n=Zo(i);e.value=!0,n.forEach((s,o)=>{o!==t&&vi(i,o)})}}function wd(i){let t=!0;return Zo(i).forEach((n,s)=>{t=t&&Qo(i,s)}),t}function Qo(i,t){return wn(i)?i.getDataVisibility(t):i.isDatasetVisible(t)}function vi(i,t,e){wn(i)?i.toggleDataVisibility(t):i.setDatasetVisibility(t,!i.isDatasetVisible(t)),e&&wd(i)&&(e.value=!1),i.update()}function kn(i,t){const e=Ko(i,""),n=vd(i),s=i.index||i.datasetIndex;return n.style.width="10px",n.style.height="10px",s%2===0?t?n.style.borderRadius="25px":n.style.transform="rotate(45deg)":t?n.style.transform="rotate(45deg)":n.style.borderRadius="25px",e.appendChild(n),e}function Si(i,t){var n,s;let e=(n=i.value)==null?void 0:n.querySelector("ul");return e||(e=document.createElement("ul"),e.style.display="flex",e.style.flexDirection=t,e.style.margin="0",e.style.padding="0",(s=i.value)==null||s.appendChild(e)),e}function ta(i){return i==="#00000000"}function Oe(i,t){const e=Math.round(Math.min(Math.max(t||1,0),1)*255);return i+e.toString(16).toUpperCase()}const{getPatternIndexWithShift:Cn}=bi();function kd(){const i=x.ref(3),t=x.ref(null),e=x.reactive({dataSetIndex:-1,columnIndex:-1});function n(g,b,p,y,_,v){return Xo(g,b,e,p,y,_,v)}function s(){i.value=4,i.value=3}function o(g,b,p,y,_,v){const S=i.value;return g.map((k,M)=>({borderColor:function(w){return p?"#00000000":r(M,w.index,y,v)},backgroundColor:function(w){return l(M,w.index,p,y,_,v)},borderWidth:function(){return p?1:S},data:k.data,label:k.label,stack:`Stack ${b?k.stack:M}`}))}function a(g,b,p,y,_){return o([g,b],!1,_,p,y)}function r(g,b,p,y){const _=Cn(g,y);return u(g,b)?p[_]:Oe(p[_],.2)}function l(g,b,p,y,_,v){const S=Cn(g,v);return u(g,b)?_[S](!1,y[S],p):_[S](!0,y[S],p)}function c(){return e.dataSetIndex<0}function h(g,b){return e.dataSetIndex===g&&e.columnIndex===b}function d(g){return e.dataSetIndex===g&&e.columnIndex<0}function u(g,b){return c()||h(g,b)||d(g)}function f(){e.dataSetIndex=-1,e.columnIndex=-1}function m(){return(g,b)=>{b[0]!==void 0?(e.dataSetIndex=b[0].datasetIndex,e.columnIndex=b[0].index):f()}}return{onHoverIndex:e,reloadChart:s,getDatasets:a,getStackedDatasets:o,getOnHoverOptions:m,getBorderColor:r,getPattern:l,privateGetHtmlLegendPlugin:n,getPatternIndexWithShift:Cn,barChartRef:t,borderWidth:i}}const{getPatternCanvas:Cd}=bi();class se{constructor(){C(this,"chartType","");C(this,"datasetIndex",0);C(this,"dataIndex",0);C(this,"titleLines",[""]);C(this,"dataToDisplay","");C(this,"xValue","");C(this,"yValue","");C(this,"patternShifting",0)}createTooltip(t,e,n,s,o,a=!1){var c,h,d,u;if(!t.tooltip.dataPoints)return;this.datasetIndex=((c=t.tooltip)==null?void 0:c.dataPoints[0].datasetIndex)||0,this.dataIndex=t.tooltip.dataPoints[0].dataIndex||0,this.xValue=n.firstLineLabel||"",this.yValue=n.secondLineLabel||"",this.chartType=n.chartType,this.dataToDisplay=e(t),this.patternShifting=n.patternShifting||0;let r=document.querySelector("#chartjs-tooltip");r||(r=this.createNewTooltipElement());const l=t.tooltip;if(l.opacity===0){r.style.opacity="0";return}if(l.body){this.titleLines=l.title||[];const f=l.body.map(this.getBody);let m="background: white;";m+="border-bottom: 1px solid #CCCCCC;",m+="border-radius: 5px;",m+="padding: 10px 20px";const g=`<div style="${m}" class="tooltipTitle">`,b=this.chartType==="DOUGHNUT"?[l.title[0].split("(")[0].trim()]:f[0];let p="",y="";const _=(u=(d=(h=t.tooltip)==null?void 0:h.dataPoints[0])==null?void 0:d.dataset)==null?void 0:u.type;this.chartType==="RADAR"||this.chartType==="LINE_CHART"?(p=this.createLegendStyle(t),y=this.createLegendInnerStyle(t)):this.chartType==="BAR_CHART"||this.chartType==="DETAILS_BAR_CHART"||this.chartType==="DOUGHNUT"?p=this.createPatternLegendStyle(t):this.chartType==="MIXED_BAR_LINE_CHART"&&(_==="bar"?p=this.createPatternLegendStyle(t):(p=this.createLegendStyle(t),y=this.createLegendInnerStyle(t))),this.addLegendToDom(g,p,y,b,m,r,s,o,a,_)}this.handleTooltipPosition(t,l,r)}handleTooltipPosition(t,e,n){const s=t.chart.canvas.getBoundingClientRect(),o=window.innerWidth,a=s.left+window.pageXOffset+e.caretX,r=s.top+window.pageYOffset+e.caretY;n.style.left=a+"px",n.style.top=r+"px",n.style.height="auto",n.style.minWidth="17rem",n.style.opacity="1",n.style.position="absolute",n.style.zIndex="99",n.style.backgroundColor="white",n.style.pointerEvents="none",n.getBoundingClientRect().width+a>o&&(n.style.left=a-n.getBoundingClientRect().width+"px")}createNewTooltipElement(){const t=document.createElement("div");return t.id="chartjs-tooltip",t.style.backgroundColor="white",t.style.borderRadius="5px",t.style.transition="opacity .5s",t.style.boxShadow="0px 1px 5px rgba(0, 0, 0, 0.2)",t.innerHTML='<div class="tooltipCtn"></div>',document.body.appendChild(t),t}createPatternLegendStyle(t){return this.createCommonLegendSquareStyle(t)}createLegendStyle(t){let e=`background-color:${t.tooltip.labelColors[0].backgroundColor}`;return e+=this.createCommonLegendSquareStyle(t),e}createCommonLegendSquareStyle(t){let e=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor}`;return e+=";min-height: 20px",e+=";min-width: 20px",e+=";border-radius: 5px",e+=";margin-right: 10px",e+=";display: flex",e+=";align-items: center",e+=";justify-content: center",e+=";background: rgba(0, 0, 0, 0.1);",e}createLegendInnerStyle(t){let e="height: 12px";return e+=";width: 12px",e+=";background-color: #FFF",e+=`;border: 2px solid ${t.tooltip.labelColors[0].borderColor};`,t.tooltip.labelPointStyles[0].pointStyle==="circle"?e+="border-radius: 25px;":t.tooltip.labelPointStyles[0].pointStyle==="rectRot"&&(e+="transform: rotate(45deg);"),e}addLegendToDom(t,e,n,s,o,a,r,l,c=!1,h){let d=t,u=`<div class="legendIcon" style="${e}">`;const f=`<div style="${n}"></div>`;u+=`${f}</div>`;const m=this.setInnerHtmlToAdd(s,o,u);d+=m;const g=a==null?void 0:a.querySelector(".tooltipCtn");(g==null?void 0:g.innerHTML)!=null&&(h?this.setInnerHtmlAndPattern(g,d,r,l,c,h):this.setInnerHtmlAndPattern(g,d,r,l,c))}setInnerHtmlToAdd(t,e,n){const a=`<span style="font-family: Arial; font-size: 16px">${t[0].split(":")[0]}</span>`;return this.chartType==="RADAR"?this.returnRadarHtml(e,n,a):this.chartType==="DOUGHNUT"?this.returnDoughnutHtml(n,a):this.returnDetailsBarchartHtml(e,n,a)}returnDoughnutHtml(t,e){const n="font-family: Arial; font-size: 16px",s=`<span style="${n}">${e.split("(")[0]}</span>`;let o=`<div style="${n}; display: flex; align-items: center; justify-content: space-between">`;return o+=`<div style="display:flex; align-items: center;" >${t+s}</div>`,o+=`<div style="${n}; margin-left:3rem;">${this.dataToDisplay}</div>`,o+="</div></div>",o}returnRadarHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; border: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.titleLines[0]}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o+="</div><div>",o}returnDetailsBarchartHtml(t,e,n){const s="font-family: Arial; font-size: 16px";let o=`<div style="${s}; display: flex; align-items: center;">${e+n}</div>`;return o+="</div>",o+=`<div style="${s}; ${t}; display:flex; justify-content: space-between;">`,o+=`<div>${this.xValue}</div>`,o+=`<div style="margin-left: 20px;">${this.titleLines[0]}</div>`,o+="</div>",o+=`<div style="${s}; ${t}; border-: none; display:flex; justify-content: space-between;">`,o+=`<div>${this.yValue}</div>`,o+=`<div style="margin-left: 20px;">${this.dataToDisplay}</div>`,o+="</div>",o}setInnerHtmlAndPattern(t,e,n,s,o=!1,a){t.innerHTML=e;const r=document.querySelector(".legendIcon"),l=new Image;let c;this.chartType==="DOUGHNUT"?c=this.dataIndex+1:c=this.datasetIndex+1;const h=ud(c,this.patternShifting);if(this.chartType!=="LINE_CHART"&&this.chartType!=="RADAR"&&a!=="line"){const d=s[h-1](!1,n[h-1],o),u=Cd(d,22,22);l.src=u.toDataURL(),r.style.backgroundImage=`url(${l.src})`}}getBody(t){return t.lines}}var oe=(i=>(i.RADAR="RADAR",i.BAR_CHART="BAR_CHART",i.MIXED_BAR_LINE_CHART="MIXED_BAR_LINE_CHART",i.DETAILS_BAR_CHART="DETAILS_BAR_CHART",i.LINE_CHART="LINE_CHART",i.DOUGHNUT="DOUGHNUT",i))(oe||{});function Md(i,t="#A274FF",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.5*o,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.75*o,o/2,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.006*o,s.rect(.25*o,o/2,a,a),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c||new CanvasPattern}function Pd(i,t="#143666",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(-o*.03,-.01*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.29*o,.33*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.63*o,.69*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.33*o,-.37*o,o+o/2,.04*o),s.fill(),s.restore(),s.save(),s.beginPath(),s.transform(.708293,.705919,-.666352,.745637,0,0),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.075*o,s.miterLimit=4,s.rect(.71*o,-.72*o,o+o/2,.04*o),s.fill(),s.restore()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Ad(i,t="#00A3B2",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o/2),s.lineTo(0,0),s.lineTo(o/2,o/2),s.lineTo(o,0),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o),s.lineTo(0,o/2),s.lineTo(o/2,o),s.lineTo(o,o/2),s.lineTo(o+o/2,o),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,111e-6),s.lineTo(4e-6*o,-o/2),s.lineTo(o/2,111e-6),s.lineTo(o,-o/2),s.lineTo(o+o/2,111e-6),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.08*o,s.moveTo(-o/2,o+o/2),s.lineTo(0,o),s.lineTo(o/2,o+o/2),s.lineTo(o,o),s.lineTo(o+o/2,o+o/2),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas").getContext("2d");if(!r)return new CanvasPattern;const l=r.createPattern(n,"repeat");return l||new CanvasPattern}function Dd(i,t="#8C1551",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=o*.15;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.fillStyle=t,s.lineWidth=.005*o,s.rect(0,0,a,o),s.fill(),s.beginPath(),s.globalAlpha=.7,s.fillStyle=t,s.lineWidth=.005*o,s.rect(o/2,0,a,o),s.fill()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const l=document.createElement("canvas").getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,o,o),c):new CanvasPattern}function Ld(i,t="#F255A3",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=new DOMMatrix,a=21,r=.1*a;n.width=a,n.height=a,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,a,a),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.005*a,s.rect(0,0,a,a),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=r,s.moveTo(r,0),s.lineTo(r,.5*a),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=r,s.moveTo(a/2+r,0),s.lineTo(a/2+r,.5*a),s.stroke()),i&&(s.beginPath(),s.fillStyle="#FFFFFF",s.globalAlpha=.5,s.lineWidth=.006*a,s.rect(0,0,a,a),s.fill());const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return new CanvasPattern;const h=c.createPattern(n,"repeat");return h?(c.fillStyle=h,c.fillRect(0,0,l.width,l.height),h.setTransform(o.rotate(45)),h):new CanvasPattern}function Td(i,t="#095359",e=!1){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return new CanvasPattern;const o=50,a=.04*o;n.width=o,n.height=o,e===!0?(s.beginPath(),s.fillStyle=t,s.rect(0,0,o,o),s.fill()):(s.beginPath(),s.fillStyle="#FFFFFF",s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.1,s.fillStyle=t,s.lineWidth=.1005*o,s.rect(0,0,o,o),s.fill(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.06*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=a,s.arc(a+.56*o,a+.06*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.3,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.44*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke(),s.beginPath(),s.globalAlpha=.7,s.strokeStyle=t,s.lineWidth=.04*o,s.arc(-a+.94*o,a+.56*o,.06*o,0,2*Math.PI),s.stroke()),i&&(s.beginPath(),s.globalAlpha=.5,s.fillStyle="#FFFFFF",s.lineWidth=.006*o,s.rect(0,0,o,o),s.fill());const r=document.createElement("canvas"),l=r.getContext("2d");if(!l)return new CanvasPattern;const c=l.createPattern(n,"repeat");return c?(l.fillStyle=c,l.fillRect(0,0,r.width,r.height),c):new CanvasPattern}function ae(){return{patternsStandardList:[Md,Pd,Ad,Dd,Ld,Td],colourSets:[["#393879","#006974","#405D68","#005C91","#8C3500","#8C0003"],["#A274FF","#143666","#00A3B2","#8C1551","#F255A3","#095359"],["#00A3B2","#143666","#3D993D","#8C1551","#E56D17","#4C3380"],["#8C1551","#E56D17","#4C3380","#4588E5","#095359","#F255A3"],["#4588E5","#4C3380","#E56D17","#143666","#D94141","#8C1551"],["#143666","#F255A3","#095359","#4588E5","#8C1551","#E56D17"],["#A274FF","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0","#B0BBC0"]]}}const Od={class:"container"},Id={class:"main"},Fd=x.defineComponent({__name:"BarChart",props:{chartId:{type:String,default:"radar-chart"},unit:{type:String,default:"%"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==n.length?e[t.colourSet]:t.newPatternsOrder.map(P=>e[t.colourSet][P])),r=x.computed(()=>t.newPatternsOrder.length!==n.length?n:t.newPatternsOrder.map(P=>n[P])),l=x.computed(()=>t.disableAccessibility),c=x.computed(()=>t.enableHoverFeature),{onHoverIndex:h,barChartRef:d,reloadChart:u,getOnHoverOptions:f,getStackedDatasets:m,privateGetHtmlLegendPlugin:g}=kd(),b=x.computed(()=>{const P=M(v.value);return _(),{labels:P,datasets:m(t.datasets.map((A,L)=>({data:S(L,v.value),label:t.datasets[L].label,stack:A.stack||0})),t.stacked,t.disableAccessibility,a.value,r.value,0)}});let p,y;const _=()=>{p=t.tooltipFirstLineLabel,y=t.tooltipSecondLineLabel},v=x.computed(()=>{const P=t.labels;if(P.includes("other")){const A=P.indexOf("other");if(t.datasets[0].data[A].rate+""=="0"&&t.datasets[1].data[A].rate+""=="0")return A}return null}),S=(P,A,L=!1)=>{const V=Object.assign([],t.datasets[P].data);return A&&v.value&&V.splice(v.value,1),V.map(U=>t.unit==="%"?U.rate:U.amount)},k=P=>{const A=P.tooltip.dataPoints[0].datasetIndex,L=P.tooltip.dataPoints[0].dataIndex,V=P.tooltip.body[0].lines[0].split(":")[1],U=t.datasets[A].data[L],F=U.rate?parseFloat(V.replace(",",".")).toFixed(2)+"% ":"",B=U.amountUnit?U.amountUnit:"",j=U.amount?tt(U.amount):"";return F+(F&&j?"/ ":"")+j+B},M=P=>{const A=Object.assign([],t.labels);return P&&A.splice(P,1),A.map(L=>L)},w=x.computed(()=>({onHover:t.enableHoverFeature?f():()=>{},elements:{bar:{borderSkipped:!1}},maxBarThickness:64,categoryPercentage:.6,plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(P){var L;const A=((L=P.tooltip.dataPoints)==null?void 0:L[0].dataIndex)||0;!t.labels[A]||t.labels[A]===""||new se().createTooltip(P,k,{chartType:oe.BAR_CHART,firstLineLabel:p,secondLineLabel:y},a.value,r.value,t.disableAccessibility)}}},scales:{x:{stacked:t.stacked,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{stacked:t.stacked,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},ticks:{callback:function(P){return t.unit==="%"?_n(P,t.unit):tt(P)+" "+t.unit}}}}})),D=x.computed(()=>g(s,o,l,a,r,c));return x.watch(h,()=>{u()},{deep:!0}),(P,A)=>(x.openBlock(),x.createElementBlock("div",Od,[x.createElementVNode("div",Id,[b.value?(x.openBlock(),x.createBlock(x.unref($o),{key:0,ref_key:"barChartRef",ref:d,id:i.chartId,data:b.value,options:w.value,plugins:D.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Lu="",Tu="",re=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},wi=re(Fd,[["__scopeId","data-v-aaa6e255"]]);wi.install=i=>{i.component("BarChart",wi)};function Rd(){const i=x.ref(null),t=x.ref(null),e=x.ref(null);function n(h,d,u,f,m,g,b,p){return Xo(h,d,t,u,f,m,p,g,b)}function s(h,d,u,f){return t.value!==null&&f?d.map((m,g)=>t.value===g?m(!1,h[g],u):m(!0,h[g],u)):d.map((m,g)=>m(!1,h[g],u))}function o(h,d){return t.value!==null&&d?h.map((u,f)=>t.value===f?u:Oe(u,.2)):h}function a(){return(h,d)=>{d[0]!==void 0?t.value=d[0].element.$context.index:t.value=null}}const r=h=>h.charAt(0).toUpperCase()+h.slice(1).toLowerCase();function l(h,d,u,f){let m=h.slice(0),g=d.slice(0);return h.length>u&&(g=c(d,u),m=m.slice(0,u-1),m.push(f)),m.map((b,p)=>`${r(b)} (${tt(g[p].rate)} %)`)}function c(h,d){if(d<1)return h;let u=h.slice(0);return h.length>d&&(u=u.slice(0,d),u[d-1]=h.slice(d).reduce((f,m)=>(f.rate+=m.rate,f.value+=m.value,f),{rate:h[d-1].rate,value:h[d-1].value})),u}return{onHoverIndex:t,privateGetHtmlLegendPlugin:n,getOnHoverOptions:a,groupDataAfterNthValue:c,getDoughnutLabels:l,getBackgroundColor:s,getFormatedText:r,getBorderColor:o,backgroundColor:e,doughnutRef:i}}const Ed={class:"container"},Bd={class:"main"},zd=x.defineComponent({__name:"DoughnutChart",props:{chartId:{type:String,default:"doughnut-chart"},data:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]},cssClasses:{type:String,default:void 0},disableAccessibility:{type:Boolean,default:!1},enableHoverFeature:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},width:{type:String,default:"400px"},height:{type:String,default:"400px"},maxValues:{type:Number,default:5},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},othersLabel:{type:String,default:"others"}},setup(i){const t=i;wt.register(Qt,te,Jt,Kt);const{colourSets:e,patternsStandardList:n}=ae(),{onHoverIndex:s,doughnutRef:o,getBackgroundColor:a,privateGetHtmlLegendPlugin:r,getOnHoverOptions:l,groupDataAfterNthValue:c,getDoughnutLabels:h,getBorderColor:d}=Rd(),u=x.ref(!1),f=x.ref(null),m=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(w=>e[t.colourSet][w])),g=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(w=>n[w])),b=x.computed(()=>({labels:h(t.labels,t.data,t.maxValues,t.othersLabel),datasets:[{data:c(t.data,t.maxValues).map(w=>w.rate),backgroundColor:a(m.value,g.value,t.disableAccessibility,t.enableHoverFeature),borderColor:d(m.value,t.enableHoverFeature)}]})),p=w=>{const D=w.tooltip.dataPoints[0].dataIndex,P=c(t.data,t.maxValues)[D],A=tt(P.rate),L=tt(P.value),V=P.unit||"";return`${L}${V} (${A})%`};function y(){return t.labels.length<=1?0:12}const _=x.computed(()=>{const w=m.value,D=g.value;return{onHover:t.enableHoverFeature?l():()=>{},plugins:{legend:{display:!1,position:"bottom",align:"start",labels:{pointStyle:"rectRounded",usePointStyle:!0}},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(P){new se().createTooltip(P,p,{chartType:oe.DOUGHNUT},w,D,S.value)}}},radius:"90%",cutout:"70%",borderWidth:3,spacing:y(),hoverOffset:4}}),v={data:t.data,labels:t.labels},S=x.computed(()=>t.disableAccessibility),k=x.computed(()=>t.enableHoverFeature),M=x.computed(()=>r(f,u,S,m,g,t.maxValues,v,k));return x.onMounted(()=>{a(m.value,g.value,t.disableAccessibility,k.value)}),x.watch(s,(w,D)=>{w!==D&&k.value&&a(m.value,g.value,t.disableAccessibility,k.value)}),x.watch(S,()=>{a(m.value,g.value,t.disableAccessibility,k.value)}),(w,D)=>(x.openBlock(),x.createElementBlock("div",Ed,[x.createElementVNode("div",Bd,[b.value?(x.openBlock(),x.createBlock(x.unref(ld),{key:0,ref_key:"doughnutRef",ref:o,id:i.chartId,data:b.value,options:_.value,plugins:M.value,"max-values":i.maxValues,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","max-values","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:f},null,512)]))}}),Ou="",ki=re(zd,[["__scopeId","data-v-b0907849"]]);ki.install=i=>{i.component("DoughnutChart",ki)};const Wd={class:"container"},Hd={class:"main"},Nd=x.defineComponent({__name:"LineChart",props:{chartId:{type:String,default:"radar-chart"},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},width:{type:String,default:"200px"},height:{type:String,default:"400px"},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},lines:{type:Array,default:()=>{}},labels:{type:Array,default:()=>[]},xAxisTitle:{type:String,default:null},yAxisTitle:{type:String,default:null},suggestedMin:{type:Number,default:void 0},suggestedMax:{type:Number,default:void 0},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,pt,ee,ie);const{colourSets:e,patternsStandardList:n}=ae(),s=x.ref(null),o=x.ref(!1),a=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(p=>e[t.colourSet][p])),r=t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(p=>n[p]),l=p=>{const y=p.tooltip.dataPoints[0].datasetIndex,_=p.tooltip.dataPoints[0].dataIndex,v=t.lines[y].data[_].toFixed(2);return t.lines[y].unit?v+" "+t.lines[y].unit:v},c=x.computed(()=>t.tooltipFirstLineLabel),h=x.computed(()=>t.tooltipSecondLineLabel),d=p=>{switch(p){case 1:return"circle";default:return"rectRot"}},u=x.computed(()=>({labels:t.labels.map(p=>p),datasets:t.lines.map((p,y)=>({type:"line",borderColor:a.value[y],pointStyle:d(y),pointBackgroundColor:"#FFFFFF",pointRadius:5,label:p.label,data:p.data,borderWidth:2}))}));function f(p,y){return[{id:"htmlLegend",afterUpdate(_){const v=Si(p,"column");for(v.style.display="flex",v.style.flexDirection="row",v.style.margin="1.375rem 1.0625rem";v.firstChild;)v.firstChild.remove();_.options.plugins.legend.labels.generateLabels(_).forEach(k=>{const M=_i(_,y,k.datasetIndex);let w;y.value?w=m(_,k):w=kn(k),w.style.boxSizing="border-box",M.style.marginRight="10px",M.appendChild(w),M.appendChild(xi(k)),v.appendChild(M)})}}]}function m(p,y){const _=Sn(p,y,null);return _.onclick=v=>{vi(p,y.datasetIndex,o),v.stopPropagation()},_}const g=f(s,o),b=x.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(p){new se().createTooltip(p,l,{chartType:oe.LINE_CHART,firstLineLabel:c.value,secondLineLabel:h.value},a.value,r,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},y:{type:"linear",display:!0,title:{display:t.yAxisTitle!==null,text:t.yAxisTitle},suggestedMin:t.suggestedMin,suggestedMax:t.suggestedMax,position:"left",grid:{drawOnChartArea:!0},ticks:{callback:function(p){const y=t.lines[0].unit;return`${tt(p)} ${y||""}`}}}}}));return(p,y)=>(x.openBlock(),x.createElementBlock("div",Wd,[x.createElementVNode("div",Hd,[u.value?(x.openBlock(),x.createBlock(x.unref(cd),{key:0,ref:"lineChartRef",id:i.chartId,data:u.value,options:b.value,plugins:x.unref(g),class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:s},null,512)]))}}),Iu="",Ci=re(Nd,[["__scopeId","data-v-8e74b12a"]]);Ci.install=i=>{i.component("LineChart",Ci)};function Vd(i,t){const e=i.ctx,n=i.scales.r,s=i.data.labels;!e||!n||!s||(e.save(),s.forEach((o,a)=>{const r=(n.getIndexAngle(a)-Math.PI/2)%(2*Math.PI),l=n.getPointPositionForValue(a,n.max);e.textAlign=r<=Math.PI/2||r>3*Math.PI/2?"left":"right";let c=r<=Math.PI/2||r>3*Math.PI/2?15:-15,h;r<0||r>Math.PI?h=-15:h=15,r>Math.PI/4&&r<3*Math.PI/4&&(h*=3),(r<-Math.PI/4||r>5*Math.PI/4)&&(h*=3,c=0),(r>11*Math.PI/8||r<-3*Math.PI/8)&&(e.textAlign="center");const d=l.y+h*(o.length-1)/2;e.font="12px Arial",o.forEach((u,f)=>{const m=f===o.length-1?jd(t)[a]:"#000000";e.fillStyle=m;const g=l.x+c,b=d+15*f;e.fillText(u,g,b)})}),e.restore())}const jd=i=>i.datasets[0].areaData.map(t=>{switch(t.color){case"red":return"#C61112";case"green":return"#46A610";default:return"#000000"}});function $d(i,t){if(i.length>7&&i.includes(" ",7)){const n=i.indexOf(" ",7);return[i.substring(0,n),i.substring(n),t]}return[i,t]}const Ud={class:"container"},Yd=x.defineComponent({__name:"RadarChart",props:{chartId:{type:String,default:"radar-chart"},height:{type:String,default:"600px"},labels:{type:Array,default:()=>[]},disableAccessibility:{type:Boolean,default:!1},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},datasets:{type:Array,default:()=>[]},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i){const t=i;wt.register(Qt,te,Jt,Le,pt,Tt,Sh);const{colourSets:e,patternsStandardList:n}=ae(),s=x.computed(()=>t.newPatternsOrder.length!==6?e[t.colourSet]:t.newPatternsOrder.map(b=>e[t.colourSet][b])),o=x.computed(()=>t.newPatternsOrder.length!==6?n:t.newPatternsOrder.map(b=>n[b])),a=x.computed(()=>({labels:d(),datasets:r()}));function r(){return t.datasets.map((b,p)=>({label:b.label,backgroundColor:Oe(s.value[p],.1),borderColor:s.value[p],pointBackgroundColor:"#FFFFFF",pointBorderColor:s.value[p],pointBorderWidth:2,borderWidth:2,pointHitRadius:55,pointRadius:5,pointStyle:p%2===0?"circle":"rectRot",pointHoverBackgroundColor:s.value[p],pointHoverBorderColor:s.value[p],data:b.areaData.map(y=>y.position)}))}const l={onClick:(b,p,y)=>{p[0]&&Jo(y,p[0].datasetIndex,h)},plugins:{htmlLegend:{containerID:"legend-container"},legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,position:"nearest",external:function(b){new se().createTooltip(b,g,{chartType:oe.RADAR},s.value,o.value,t.disableAccessibility)}}},layout:{padding:{left:130,right:95,top:95,bottom:95}},scales:{r:{min:0,max:100,pointLabels:{display:!1,font:{weight:400,family:"Roboto"}},ticks:{display:!1,stepSize:25}}}},c=x.ref(null),h=x.ref(!1),d=()=>t.labels.map((b,p)=>{const y=t.datasets[0].areaData[p].value?`${u(t.datasets[0].areaData[p].value+"")} ${t.datasets[0].areaData[p].unit}`:"No Data";return $d(b,y)}),u=b=>tt(parseFloat(b));function f(b,p){const y=Sn(b,p,null);return y.onclick=_=>{vi(b,p.datasetIndex,h),_.stopPropagation()},y}const m=[{id:"htmlLegend",afterUpdate(b){const p=Si(c,"row");for(;p.firstChild;)p.firstChild.remove();b.options.plugins.legend.labels.generateLabels(b).reverse().forEach(_=>{const v=_i(b,h,_.datasetIndex);let S;v.style.marginRight="0.625rem",h.value?S=f(b,_):S=kn(_,!0),v.appendChild(S),v.appendChild(xi(_)),p.appendChild(v)})}},{id:"radarLabelPlugin",beforeDraw(b){Vd(b,t)}}],g=b=>{const p=b.tooltip.dataPoints[0].datasetIndex,y=b.tooltip.dataPoints[0].dataIndex,_=t.datasets[p];return _.areaData[y].value.toFixed(2)+" "+_.areaData[y].unit};return(b,p)=>(x.openBlock(),x.createElementBlock("div",Ud,[x.createElementVNode("div",{class:"main",style:x.normalizeStyle({height:i.height})},[a.value?(x.openBlock(),x.createBlock(x.unref(hd),{key:0,id:i.chartId,data:a.value,options:l,plugins:m,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","class","style"])):x.createCommentVNode("",!0)],4),x.createElementVNode("div",{ref_key:"legendContainer",ref:c,class:"legendContainer"},null,512)]))}}),Fu="",Mi=re(Yd,[["__scopeId","data-v-00cff15e"]]);Mi.install=i=>{i.component("RadarChart",Mi)};const ea=Object.freeze(Object.defineProperty({__proto__:null,BarChart:wi,DoughnutChart:ki,LineChart:Ci,RadarChart:Mi},Symbol.toStringTag,{value:"Module"})),{getPatternIndexWithShift:ia}=bi();function Xd(){const i=x.ref(2),t=x.reactive({dataSetIndex:-1,columnIndex:-1});function e(d,u,f,m,g,b){return[{id:"htmlLegend",afterUpdate(p){const y=Si(d,"column");for(y.style.display="flex",y.style.margin="1.375rem 1.0625rem",y.style.flexDirection="row-reverse",y.style.flexWrap="wrap",y.style.justifyContent="flex-end";y.firstChild;)y.firstChild.remove();p.options.plugins.legend.labels.generateLabels(p).sort((v,S)=>S.datasetIndex-v.datasetIndex).forEach(v=>{const S=_i(p,u,v.datasetIndex);let k;u.value?k=qo(p,v,u,{datasetIndex:-1},g.value,!1):v!=null&&v.lineCap?k=kn(v):k=Go(v,p,{datasetIndex:-1},m.value,g.value,b.value,!1),k.style.boxSizing="border-box",S.style.marginRight="10px",S.style.marginBottom="2px",S.appendChild(k),S.appendChild(xi(v)),y.appendChild(S)})}}]}function n(d,u,f,m,g){return e(d,u,t,f,m,g)}function s(d,u,f,m,g){const b=i.value;return d.map((p,y)=>{const _=p.type==="bar";return{type:p.type,fill:_?null:!1,borderWidth:function(){return u&&_?1:b},borderColor:function(v){return u&&_?"#00000000":_?o(y,v.index,f,g):f[y%f.length]},backgroundColor:function(v){return a(y,v.index,u,f,m,g)},yAxisID:_?"A":"B",pointStyle:y%2===0?"rectRot":"circle",data:p.data,label:p.label,pointBackgroundColor:"#FFFFFF",pointRadius:5,order:p.type==="line"?0:1}})}function o(d,u,f,m){const g=ia(d,m);return r(d,u)?f[g]:Oe(f[g],.2)}function a(d,u,f,m,g,b){const p=ia(d,b);return r(d,u)?g[p](!1,m[p],f):g[p](!0,m[p],f)}function r(d,u){return l()||c(d,u)||h(d)}function l(){return t.dataSetIndex<0}function c(d,u){return t.dataSetIndex===d&&t.columnIndex===u}function h(d){return t.dataSetIndex===d&&t.columnIndex<0}return{privateGetHtmlLegendPlugin:n,getMixedDatasets:s,getBorderColor:o,getPattern:a,onHoverIndex:t}}const Gd={class:"container"},qd={class:"main"},Kd=x.defineComponent({__name:"MixedBarLineChart",props:{chartId:{type:String,default:"mixed-bar-line-chart"},unit:{type:String,default:""},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},newPatternsOrder:{type:Array,default:()=>[0,1,2,3,4,5]},barDatasets:{type:Array,default:()=>[]},barUnit:{type:String,default:""},lineDatasets:{type:Array,default:()=>[]},lineUnit:{type:String,default:""},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},stacked:{type:Boolean,default:!1},disableAccessibility:{type:Boolean,default:!1},tooltipFirstLineLabel:{type:String,default:"content"},tooltipSecondLineLabel:{type:String,default:"content2"},xAxisTitle:{type:String,default:null},yLeftAxisTitle:{type:String,default:null},yRightAxisTitle:{type:String,default:null}},setup(i){const t=i;wt.register(Qt,te,Jt,Zt,ee,ie,pt,Tt);const{privateGetHtmlLegendPlugin:e,getMixedDatasets:n}=Xd(),{colourSets:s,patternsStandardList:o}=ae(),a=x.ref(null),r=x.ref(!1),l=x.computed(()=>{let p=[];return t.barDatasets&&(p=p.concat(t.barDatasets)),t.lineDatasets&&(p=p.concat(t.lineDatasets)),p}),c=x.computed(()=>t.newPatternsOrder.length!==o.length?s[t.colourSet]:t.newPatternsOrder.map(p=>s[t.colourSet][p])),h=x.computed(()=>t.newPatternsOrder.length!==o.length?o:t.newPatternsOrder.map(p=>o[p])),d=x.computed(()=>t.disableAccessibility),u=x.computed(()=>({labels:m(),datasets:n(l.value,d.value,c.value,h.value,0)})),f=p=>{const y=p.tooltip.dataPoints[0].datasetIndex,_=p.tooltip.dataPoints[0].dataIndex,v=l.value[y].data[_],S=l.value[y].type==="bar"?t.barUnit:t.lineUnit;return(S==="%"?parseFloat(v.toString().replace(",",".")).toFixed(2):tt(v))+S},m=()=>Object.assign([],t.labels).map(y=>y),g=x.computed(()=>({type:"bar",responsive:!0,maintainAspectRatio:!0,maxBarThickness:64,categoryPercentage:.6,elements:{bar:{borderSkipped:!1}},plugins:{legend:{display:!1},title:{display:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:function(p){new se().createTooltip(p,f,{chartType:oe.MIXED_BAR_LINE_CHART,firstLineLabel:t.tooltipFirstLineLabel,secondLineLabel:t.tooltipSecondLineLabel},c.value,h.value,t.disableAccessibility)}}},scales:{x:{offset:!0,title:{display:t.xAxisTitle!==null,text:t.xAxisTitle}},A:{type:"linear",display:!0,position:"left",grid:{drawOnChartArea:!0},title:{display:t.yLeftAxisTitle!==null,text:t.yLeftAxisTitle},ticks:{callback:function(p){return t.barUnit==="%"?_n(p,t.unit):tt(p)+" "+t.barUnit}}},B:{type:"linear",display:!0,position:"right",grid:{drawOnChartArea:!1},title:{display:t.yRightAxisTitle!==null,text:t.yRightAxisTitle},ticks:{callback:function(p){return(t.lineUnit==="%"?_n(p,t.unit):tt(p))+" "+t.lineUnit}}}}})),b=x.ref(e(a,r,d,c,h));return(p,y)=>(x.openBlock(),x.createElementBlock("div",Gd,[x.createElementVNode("div",qd,[u.value?(x.openBlock(),x.createBlock(x.unref($o),{key:0,ref:"mixedBarLineChartRef",id:i.chartId,data:u.value,options:g.value,plugins:b.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","plugins","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",{ref_key:"legendContainer",ref:a},null,512)]))}}),Ru="",Eu="",Mn=re(Kd,[["__scopeId","data-v-6a9cb065"]]);Mn.install=i=>{i.component("MixedBarLineChart",Mn)};const Zd="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBmaWxsPSJub25lIj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNy41IiBzdHJva2U9IiM2NjY2NjYiLz4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iMTEuMiIgcj0iNC4zIiBzdHJva2U9IiM2NjY2NjYiLz4KPC9zdmc+";/*!
|
|
23
23
|
* chartjs-plugin-datalabels v2.2.0
|
|
24
24
|
* https://chartjs-plugin-datalabels.netlify.app
|
|
25
25
|
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaic-ds/chart",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vue-tsc && vite build",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"release:beta": "release-it --preRelease=beta",
|
|
19
19
|
"storybook": "storybook dev -p 6006",
|
|
20
20
|
"test": "vitest --run",
|
|
21
|
-
"vitest": "vitest ChartsCommonLegend.test.ts"
|
|
21
|
+
"vitest": "vitest ChartsCommonLegend.test.ts",
|
|
22
|
+
"format": "prettier . --write"
|
|
22
23
|
},
|
|
23
24
|
"bugs": {
|
|
24
25
|
"url": "https://github.com/adeo/mozaic-chart/issues"
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"jsdom": "^22.1.0",
|
|
73
74
|
"mdx-mermaid": "^2.0.0",
|
|
74
75
|
"mermaid": "^10.3.1",
|
|
76
|
+
"prettier": "^3.3.3",
|
|
75
77
|
"react": "^18.2.0",
|
|
76
78
|
"react-dom": "^18.2.0",
|
|
77
79
|
"release-it": "^16.1.3",
|
|
@@ -53,6 +53,7 @@ export default function () {
|
|
|
53
53
|
ul.style.display = 'flex';
|
|
54
54
|
ul.style.margin = '1.375rem 1.0625rem';
|
|
55
55
|
ul.style.flexDirection = 'row-reverse';
|
|
56
|
+
ul.style.flexWrap = 'wrap';
|
|
56
57
|
ul.style.justifyContent = 'flex-end';
|
|
57
58
|
while (ul.firstChild) {
|
|
58
59
|
ul.firstChild.remove();
|
|
@@ -92,6 +93,7 @@ export default function () {
|
|
|
92
93
|
}
|
|
93
94
|
liContent.style.boxSizing = 'border-box';
|
|
94
95
|
li.style.marginRight = '10px';
|
|
96
|
+
li.style.marginBottom = '2px';
|
|
95
97
|
li.appendChild(liContent);
|
|
96
98
|
li.appendChild(createHtmlLegendItemText(item));
|
|
97
99
|
ul.appendChild(li);
|