vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
913 lines • 63.7 kB
JavaScript
import { defineAsyncComponent as G, useSlots as Zt, computed as w, ref as p, onMounted as ct, watch as ht, shallowRef as vt, onBeforeUnmount as Kt, nextTick as be, createElementBlock as n, openBlock as s, unref as y, normalizeStyle as J, normalizeClass as oe, createBlock as q, createCommentVNode as g, renderSlot as z, createElementVNode as Z, createVNode as fe, createSlots as dt, withCtx as _, normalizeProps as F, guardReactiveProps as E, Fragment as v, renderList as f, mergeProps as Me, toDisplayString as T, createTextVNode as Qt } from "vue";
import { u as jt, c as yt, t as ea, p as me, a as ta, C as te, b as aa, o as la, e as gt, g as ra, d as sa, al as pe, ai as bt, D as ft, X as oa, l as ia, a7 as xe, F as mt, i as ke, f as K, I as na, am as ua, x as pt, q as ca, r as ha, y as va } from "./index-BLtEpj8j.js";
import { u as xt } from "./useNestedProp-Bw1KcAmj.js";
import { t as da, u as ya } from "./useResponsive-DfdjqQps.js";
import { u as ga } from "./usePrinter-DnRwTdvS.js";
import { u as ba } from "./useUserOptionState-BIvW1Kz7.js";
import { u as fa } from "./useChartAccessibility-9icAAmYg.js";
import ma from "./Legend-E7G897sw.js";
import { S as pa } from "./Slicer-D-HtJC7M.js";
import xa from "./Title-DkG60EPg.js";
import { _ as ka } from "./Shape-Cqnzky8X.js";
import { u as wa } from "./useTimeLabels-DFkUfjfs.js";
import za from "./img-D-vWHxhM.js";
import { _ as La } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Ca = ["id"], _a = ["xmlns", "viewBox"], Sa = ["x", "y", "width", "height"], $a = { key: 1 }, Ma = ["id"], Ta = ["stop-color"], Na = ["stop-color"], Ia = ["stop-color"], Pa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Oa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ra = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Va = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Aa = { key: 0 }, Ua = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], Da = { key: 0 }, Fa = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], Ea = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Ha = { key: 0 }, Ba = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Wa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ya = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xa = ["x", "y", "font-size", "fill", "font-weight"], Ga = ["transform", "font-size", "fill", "font-weight"], Ja = ["x", "y", "font-size", "fill", "font-weight"], qa = { key: 0 }, Za = ["x", "y", "font-size", "font-weight", "fill"], Ka = ["x", "y", "font-size", "fill", "font-weight"], Qa = { key: 0 }, ja = ["x", "y", "font-size", "font-weight", "fill"], el = ["x1", "x2", "y1", "y2", "stroke"], tl = ["x", "y", "font-size", "font-weight", "fill"], al = ["x1", "x2", "y1", "y2", "stroke"], ll = ["font-size", "font-weight", "fill", "text-anchor", "transform"], rl = { key: 0 }, sl = { key: 1 }, ol = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], il = ["text-anchor", "font-size", "fill", "transform", "innerHTML", "onClick"], nl = { key: 0 }, ul = { key: 1 }, cl = ["font-size", "font-weight", "fill", "x", "y", "onClick"], hl = ["font-size", "font-weight", "fill", "x", "y", "onClick", "innerHTML"], vl = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], dl = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], yl = {
key: 4,
class: "vue-data-ui-watermark"
}, gl = ["onClick"], bl = ["innerHTML"], fl = {
__name: "vue-ui-stackbar",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectDatapoint", "selectLegend", "selectTimeLabel"],
setup(we, { expose: kt, emit: wt }) {
const zt = G(() => import("./vue-ui-accordion-B6Svdk-2.js")), Lt = G(() => import("./DataTable-CS_V_Adx.js")), Ct = G(() => import("./PackageVersion-CnRyWKP-.js")), _t = G(() => import("./PenAndPaper-7BWf7zgA.js")), St = G(() => import("./vue-ui-skeleton-CsMU8DwQ.js")), $t = G(() => import("./Tooltip-CuHsd1IQ.js")), Mt = G(() => import("./UserOptions-DGw0HvSp.js")), { vue_ui_stackbar: Tt } = jt(), Nt = Zt(), b = we, ze = wt, Q = w({
get() {
return !!b.dataset && b.dataset.length;
},
set(a) {
return a;
}
}), R = p(null), V = p(yt()), ie = p(!1), Le = p(null), Ce = p(""), S = p([]), Te = p(0), Ne = p(null), Ie = p(null), Pe = p(null), Oe = p(null), Re = p(0), ne = p(!1), ae = p(null), H = p(!1), Ve = p(0), It = p(0), Pt = p(0), j = p(null);
ct(() => {
Se();
});
const e = w({
get: () => Fe(),
set: (a) => a
}), { userOptionsVisible: _e, setUserOptionsVisibility: Ae, keepUserOptionState: Ue } = ba({ config: e.value }), { svgRef: De } = fa({ config: e.value.style.chart.title });
function Fe() {
const a = xt({
userConfig: b.config,
defaultConfig: Tt
});
let r = {};
return a.theme ? r = {
...xt({
userConfig: ta.vue_ui_stackbar[a.theme] || b.config,
defaultConfig: a
}),
customPalette: ea[a.theme] || me
} : r = a, b.config && te(b.config, "style.chart.grid.scale.scaleMin") ? r.style.chart.grid.scale.scaleMin = b.config.style.chart.grid.scale.scaleMin : r.style.chart.grid.scale.scaleMin = null, b.config && te(b.config, "style.chart.grid.scale.scaleMax") ? r.style.chart.grid.scale.scaleMax = b.config.style.chart.grid.scale.scaleMax : r.style.chart.grid.scale.scaleMax = null, b.config && te(b.config, "style.chart.zoom.startIndex") ? r.style.chart.zoom.startIndex = b.config.style.chart.zoom.startIndex : r.style.chart.zoom.startIndex = null, b.config && te(b.config, "style.chart.zoom.endIndex") ? r.style.chart.zoom.endIndex = b.config.style.chart.zoom.endIndex : r.style.chart.zoom.endIndex = null, b.config && te(b.config, "style.chart.bars.dataLabels.hideUnderValue") ? r.style.chart.bars.dataLabels.hideUnderValue = b.config.style.chart.bars.dataLabels.hideUnderValue : r.style.chart.bars.dataLabels.hideUnderValue = null, b.config && te(b.config, "style.chart.bars.dataLabels.hideUnderPercentage") ? r.style.chart.bars.dataLabels.hideUnderPercentage = b.config.style.chart.bars.dataLabels.hideUnderPercentage : r.style.chart.bars.dataLabels.hideUnderPercentage = null, r;
}
const Ee = w(() => e.value.style.chart.bars.dataLabels.hideUnderValue !== null), He = w(() => e.value.style.chart.bars.dataLabels.hideUnderPercentage !== null);
ht(() => b.config, (a) => {
e.value = Fe(), _e.value = !e.value.userOptions.showOnChartHover, Se(), Ve.value += 1, It.value += 1, Pt.value += 1, L.value.dataLabels.show = e.value.style.chart.bars.dataLabels.show, L.value.showTable = e.value.table.show, L.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 }), ht(() => b.dataset, (a) => {
Je();
}, { deep: !0 });
const L = p({
dataLabels: {
show: e.value.style.chart.bars.dataLabels.show
},
showTable: e.value.table.show,
showTooltip: e.value.style.chart.tooltip.show
}), { isPrinting: Be, isImaging: We, generatePdf: Ye, generateImage: Xe } = ga({
elementId: `stackbar_${V.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-stackbar",
options: e.value.userOptions.print
}), ue = p({
width: e.value.style.chart.width,
height: e.value.style.chart.height,
paddingRatio: {
top: e.value.style.chart.padding.top / e.value.style.chart.height,
right: e.value.style.chart.padding.right / e.value.style.chart.width,
bottom: e.value.style.chart.padding.bottom / e.value.style.chart.height,
left: e.value.style.chart.padding.left / e.value.style.chart.width
}
}), Ot = w(() => aa(e.value.customPalette)), A = vt(null), ee = vt(null), Ge = p(null);
ct(() => {
Se();
});
function Se() {
if (la(b.dataset) ? gt({
componentName: "VueUiStackbar",
type: "dataset"
}) : b.dataset.forEach((a, r) => {
ra({
datasetObject: a,
requiredAttributes: ["name", "series"]
}).forEach((t) => {
Q.value = !1, gt({
componentName: "VueUiStackbar",
type: "datasetSerieAttribute",
property: t,
index: r
});
});
}), setTimeout(() => {
H.value = !0;
}, 10), e.value.responsive) {
const a = da(() => {
H.value = !1;
const { width: r, height: t } = ya({
chart: R.value,
title: e.value.style.chart.title.text ? Ne.value : null,
legend: e.value.style.chart.legend.show ? Ie.value : null,
slicer: e.value.style.chart.zoom.show && D.value > 1 ? Pe.value : null,
source: Oe.value
});
requestAnimationFrame(() => {
ue.value.width = r, ue.value.height = t, clearTimeout(Ge.value), Ge.value = setTimeout(() => {
H.value = !0;
}, 10);
});
});
A.value && (ee.value && A.value.unobserve(ee.value), A.value.disconnect()), A.value = new ResizeObserver(a), ee.value = R.value.parentNode, A.value.observe(ee.value);
}
qe();
}
Kt(() => {
A.value && (ee.value && A.value.unobserve(ee.value), A.value.disconnect());
});
const o = w(() => {
const { height: a, width: r } = ue.value, { right: t } = ue.value.paddingRatio, l = e.value.style.chart.padding.top, c = r - r * t, u = a - e.value.style.chart.padding.bottom, C = e.value.style.chart.padding.left, B = r - C - r * t, W = a - l - e.value.style.chart.padding.bottom;
return {
chartHeight: a,
chartWidth: r,
top: l,
right: c,
bottom: u,
left: C,
width: B,
height: W < 0 ? 0 : W
};
}), U = w(() => b.dataset.map((a, r) => {
const t = sa(a.color) || Ot.value[r] || me[r] || me[r % me.length];
return {
...a,
// In distributed mode, all values are converted to positive
series: JSON.parse(JSON.stringify(a.series)).map((l) => e.value.style.chart.bars.distributed ? Math.abs(l) : l),
// Store signs to manage display of neg values in distributed mode
signedSeries: a.series.map((l) => l >= 0 ? 1 : -1),
absoluteIndex: r,
id: yt(),
color: t
};
})), D = w(() => Math.max(...U.value.filter((a) => !S.value.includes(a.id)).map((a) => a.series.length))), h = p({
start: 0,
end: Math.max(...b.dataset.map((a) => a.series.length))
});
function Je() {
qe();
}
async function qe() {
(e.value.style.chart.zoom.startIndex !== null || e.value.style.chart.zoom.endIndex !== null) && j.value ? (e.value.style.chart.zoom.startIndex !== null && (await be(), await be(), j.value && j.value.setStartValue(e.value.style.chart.zoom.startIndex)), e.value.style.chart.zoom.endIndex !== null && (await be(), await be(), j.value && j.value.setEndValue(Rt(e.value.style.chart.zoom.endIndex + 1)))) : (h.value = {
start: 0,
end: Math.max(...b.dataset.map((a) => a.series.length))
}, Re.value += 1);
}
function Rt(a) {
const r = Math.max(...b.dataset.map((t) => t.series.length));
return a > r ? r : a < 0 || e.value.style.chart.zoom.startIndex !== null && a < e.value.style.chart.zoom.startIndex ? e.value.style.chart.zoom.startIndex !== null ? e.value.style.chart.zoom.startIndex + 1 : 1 : a;
}
const d = w(() => {
let a;
return e.value.orientation === "vertical" ? a = o.value.width / (h.value.end - h.value.start) : a = o.value.height / (h.value.end - h.value.start), a <= 0 ? 0 : a;
}), le = w(() => pe(U.value.filter((a) => !S.value.includes(a.id))).slice(h.value.start, h.value.end)), Vt = w(() => pe(U.value.filter((a) => !S.value.includes(a.id)).map((a) => ({
...a,
series: a.series.map((r, t) => a.signedSeries[t] === -1 && r >= 0 ? -r : r)
}))).slice(h.value.start, h.value.end)), ce = w(() => {
const a = U.value.filter((r) => !S.value.includes(r.id));
return {
positive: pe(a.map((r) => ({
...r,
series: r.series.slice(h.value.start, h.value.end).map((t) => t >= 0 ? t : 0)
}))),
negative: pe(a.map((r) => ({
...r,
series: r.series.slice(h.value.start, h.value.end).map((t) => t < 0 ? t : 0)
})))
};
}), P = w(() => {
const a = e.value.style.chart.grid.scale.scaleMax !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMax : Math.max(...ce.value.positive), r = Math.min(...ce.value.negative), t = e.value.style.chart.grid.scale.scaleMin !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMin : [-1 / 0, 1 / 0, NaN, void 0, null].includes(r) ? 0 : r, l = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? bt(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks) : ft(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks);
return l.ticks.map((c) => ({
zero: o.value.bottom - o.value.height * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
y: o.value.bottom - o.value.height * ((c + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
x: o.value.left - 8,
horizontal_zero: o.value.left + o.value.width * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
horizontal_x: o.value.left + o.value.width * ((c + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
horizontal_y: o.value.bottom - 8,
value: c
}));
}), $ = w(() => wa({
values: e.value.style.chart.grid.x.timeLabels.values,
maxDatapoints: D.value,
formatter: e.value.style.chart.grid.x.timeLabels.datetimeFormatter,
start: h.value.start,
end: h.value.end
})), k = w(() => {
if (!Q.value) return [];
let a = Array(D.value).fill(0), r = Array(D.value).fill(0), t = Array(D.value).fill(0), l = Array(D.value).fill(0);
const c = Math.max(...ce.value.positive) || 0, u = Math.min(...ce.value.negative), C = [-1 / 0, 1 / 0, NaN, void 0, null].includes(u) ? 0 : u, B = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? bt(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : C > 0 ? 0 : C, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : c < 0 ? 0 : c, e.value.style.chart.grid.scale.ticks) : ft(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : C > 0 ? 0 : C, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : c < 0 ? 0 : c, e.value.style.chart.grid.scale.ticks), { min: W, max: re } = B, Y = re + (W >= 0 ? 0 : Math.abs(W)) || 1, M = o.value.height, ge = o.value.width, nt = P.value[0] ? P.value[0].zero : o.value.bottom, ut = P.value[0] ? P.value[0].horizontal_zero : o.value.left;
return U.value.filter((se) => !S.value.includes(se.id)).map((se) => {
const O = se.series.slice(h.value.start, h.value.end), Ht = se.signedSeries.slice(h.value.start, h.value.end), Bt = O.map((m, x) => o.value.left + d.value * x + d.value * e.value.style.chart.bars.gapRatio / 4), Wt = O.map((m, x) => o.value.top + d.value * x + d.value * e.value.style.chart.bars.gapRatio / 4), Yt = O.map((m, x) => {
const N = e.value.style.chart.bars.distributed ? (m || 0) / le.value[x] : (m || 0) / Y;
let X, I;
return m > 0 ? (I = M * N, X = nt - I - a[x], a[x] += I) : (I = M * N, X = nt + t[x], t[x] += Math.abs(I)), X;
}), Xt = O.map((m, x) => {
const N = e.value.style.chart.bars.distributed ? (m || 0) / le.value[x] : (m || 0) / Y;
let X, I;
return m > 0 ? (I = ge * N, X = ut + r[x], r[x] += I) : (I = ge * N, X = ut - Math.abs(I) - l[x], l[x] += Math.abs(I)), X;
}), Gt = O.map((m, x) => {
const N = e.value.style.chart.bars.distributed ? (m || 0) / le.value[x] : (m || 0) / Y;
return m > 0 ? M * N : M * Math.abs(N);
}), Jt = O.map((m, x) => {
const N = e.value.style.chart.bars.distributed ? (m || 0) / le.value[x] : (m || 0) / Y;
return m > 0 ? ge * N : ge * Math.abs(N);
}), qt = O.map((m) => Math.abs(m)).reduce((m, x) => m + x, 0);
return {
...se,
proportions: O.map((m, x) => e.value.style.chart.bars.distributed ? (m || 0) / le.value[x] : (m || 0) / qt),
series: O,
signedSeries: Ht,
x: Bt,
y: Yt,
height: Gt,
horizontal_width: Jt,
horizontal_y: Wt,
horizontal_x: Xt
};
});
}), Ze = w(() => Vt.value.map((a, r) => ({
value: a,
sign: a >= 0 ? 1 : -1
})));
function he(a, r, t, l, c) {
const u = c === -1 && a >= 0 ? -a : a;
return ke(
e.value.style.chart.bars.dataLabels.formatter,
u,
K({
p: e.value.style.chart.bars.dataLabels.prefix,
v: u,
s: e.value.style.chart.bars.dataLabels.suffix,
r: e.value.style.chart.bars.dataLabels.rounding
}),
{ datapoint: r, seriesIndex: t, datapointIndex: l }
);
}
function Ke(a, r, t, l) {
return ke(
e.value.style.chart.bars.dataLabels.formatter,
a,
K({
v: isNaN(a) ? 0 : a,
s: "%",
r: e.value.style.chart.bars.dataLabels.rounding
}),
{ datapoint: r, seriesIndex: t, datapointIndex: l }
);
}
function Qe(a) {
const r = JSON.parse(JSON.stringify(k.value)).map((t) => ({
name: t.name,
value: t.series[a] === 0 ? 0 : t.series[a] || null,
proportion: t.proportions[a] || null,
color: t.color,
id: t.id
}));
ze("selectDatapoint", { datapoint: r, period: $.value[a] });
}
function je(a) {
ae.value = a, ie.value = !0;
const r = e.value.style.chart.tooltip.customFormat, t = JSON.parse(JSON.stringify(k.value)).map((c) => ({
name: c.name,
absoluteIndex: c.absoluteIndex,
value: c.series[a] === 0 ? 0 : (c.signedSeries[a] === -1 && c.series[a] >= 0 ? -c.series[a] : c.series[a]) || null,
proportion: c.proportions[a] || null,
color: c.color,
id: c.id
}));
Le.value = {
datapoint: t,
seriesIndex: a,
config: e.value,
series: k.value
};
const l = t.map((c) => Math.abs(c.value)).reduce((c, u) => c + u, 0);
if (pt(r) && va(() => r({
seriesIndex: a,
datapoint: t,
series: k.value,
config: e.value
})))
Ce.value = r({
seriesIndex: a,
datapoint: t,
series: k.value,
config: e.value
});
else {
const {
showValue: c,
showPercentage: u,
borderColor: C,
roundingValue: B,
roundingPercentage: W
} = e.value.style.chart.tooltip;
let re = "";
$.value[a] && $.value[a].text && e.value.style.chart.tooltip.showTimeLabel && (re += `<div style="width:100%;text-align:center;border-bottom:1px solid ${C};padding-bottom:6px;margin-bottom:3px;">${$.value[a].text}</div>`);
const Y = [
c && u ? "(" : "",
c && u ? ")" : ""
];
t.reverse().forEach((M) => {
re += `
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
<svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${e.value.style.chart.bars.gradient.show ? `url(#gradient_${M.id})` : M.color}"/>${Nt.pattern ? `<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${V.value}_${M.absoluteIndex})"/>` : ""}</svg>
${M.name}${c || u ? ":" : ""} ${c ? K({
p: e.value.style.chart.bars.dataLabels.prefix,
v: M.value,
s: e.value.style.chart.bars.dataLabels.suffix,
r: B
}) : ""} ${Y[0]}${u ? K({
v: isNaN(M.value / l) ? 0 : Math.abs(M.value) / l * 100,
// Negs are absed to show relative proportion to absolute total. It's opinionated.
s: "%",
r: W
}) : ""}${Y[1]}
</div>
`;
}), Ce.value = `<div>${re}</div>`;
}
}
function et(a) {
ne.value = a, Te.value += 1;
}
function tt() {
L.value.showTable = !L.value.showTable;
}
function at() {
L.value.dataLabels.show = !L.value.dataLabels.show;
}
function lt() {
L.value.showTooltip = !L.value.showTooltip;
}
function At() {
return k.value;
}
const rt = w(() => {
if (k.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
const a = k.value.map(({ name: t, color: l }) => ({
label: t,
color: l
})), r = [];
return $.value.forEach((t) => {
const l = [e.value.style.chart.grid.x.timeLabels.values[t.absoluteIndex] ? t.text : i + 1];
U.value.forEach((c) => {
l.push(Number((c.series[t.absoluteIndex] || 0).toFixed(e.value.table.td.roundingValue)));
}), r.push(l);
}), { head: a, body: r };
});
function st(a = null) {
const r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], t = ["", ...rt.value.head.map((C) => C.label)], l = rt.value.body, c = r.concat([t]).concat(l), u = ca(c);
a ? a(u) : ha({ csvContent: u, title: e.value.style.chart.title.text || "vue-ui-stackbar" });
}
const ve = w(() => {
const a = [""].concat(k.value.map((c) => c.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');
let r = [];
for (let c = 0; c < D.value; c += 1) {
const u = k.value.map((C) => C.series[c] ?? 0).reduce((C, B) => C + B, 0);
r.push([e.value.style.chart.grid.x.timeLabels.values.slice(h.value.start, h.value.end)[c] ? $.value[c].text : c + 1].concat(k.value.map((C) => (C.series[c] ?? 0).toFixed(e.value.table.td.roundingValue))).concat((u ?? 0).toFixed(e.value.table.td.roundingValue)));
}
const t = {
th: {
backgroundColor: e.value.table.th.backgroundColor,
color: e.value.table.th.color,
outline: e.value.table.th.outline
},
td: {
backgroundColor: e.value.table.td.backgroundColor,
color: e.value.table.td.color,
outline: e.value.table.td.outline
},
breakpoint: e.value.table.responsiveBreakpoint
}, l = [e.value.table.columnNames.period].concat(k.value.map((c) => c.name)).concat(e.value.table.columnNames.total);
return { head: a, body: r.slice(0, h.value.end - h.value.start), config: t, colNames: l };
});
function Ut(a, r) {
if (ze("selectLegend", k.value.find((t) => t.absoluteIndex === a)), S.value.includes(r.id))
S.value = S.value.filter((t) => t !== r.id);
else {
if (S.value.length === U.value.length - 1) return;
S.value.push(r.id);
}
}
const ot = w(() => U.value.map((a, r) => ({
...a,
shape: "square"
})).map((a) => ({
...a,
opacity: S.value.includes(a.id) ? 0.5 : 1,
segregate: () => Ut(a.absoluteIndex, a),
isSegregated: S.value.includes(a.id)
}))), Dt = w(() => ({
cy: "stackbar-legend",
backgroundColor: e.value.style.chart.legend.backgroundColor,
color: e.value.style.chart.legend.color,
fontSize: e.value.style.chart.legend.fontSize,
paddingBottom: 12,
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
})), de = p(!1);
function $e() {
de.value = !de.value;
}
function ye(a, r) {
const t = JSON.parse(JSON.stringify(k.value)).map((l) => ({
name: l.name,
value: l.series[r] === 0 ? 0 : (l.signedSeries[r] === -1 && l.series[r] >= 0 ? -l.series[r] : l.series[r]) || null,
proportion: l.proportions[r] || null,
color: l.color,
id: l.id
}));
ze("selectTimeLabel", {
datapoint: t,
absoluteIndex: a.absoluteIndex,
label: a.text
});
}
const Ft = w(() => Math.max(...k.value.flatMap((a) => a.series)));
function it(a, r) {
return e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? He.value ? r * 100 >= e.value.style.chart.bars.dataLabels.hideUnderPercentage : e.value.style.chart.bars.dataLabels.hideEmptyPercentages ? r > 0 : !0 : He.value ? (Ee.value && console.warn("Vue Data UI - VueUiStackbar - You cannot set both dataLabels.hideUnderPercentage and dataLabels.hideUnderValue. Note that dataLabels.hideUnderPercentage takes precedence in this case."), a > Ft.value * e.value.style.chart.bars.dataLabels.hideUnderPercentage / 100) : Ee.value ? Math.abs(a) >= e.value.style.chart.bars.dataLabels.hideUnderValue : e.value.style.chart.bars.dataLabels.hideEmptyValues ? a !== 0 : !0;
}
async function Et({ scale: a = 2 } = {}) {
if (!R.value) return;
const { width: r, height: t } = R.value.getBoundingClientRect(), l = r / t, { imageUri: c, base64: u } = await za({ domElement: R.value, base64: !0, img: !0, scale: a });
return {
imageUri: c,
base64: u,
title: e.value.style.chart.title.text,
width: r,
height: t,
aspectRatio: l
};
}
return kt({
getData: At,
getImage: Et,
generatePdf: Ye,
generateCsv: st,
generateImage: Xe,
toggleTable: tt,
toggleLabels: at,
toggleTooltip: lt,
toggleAnnotator: $e,
toggleFullscreen: et
}), (a, r) => (s(), n("div", {
id: `stackbar_${V.value}`,
ref_key: "stackbarChart",
ref: R,
class: oe({ "vue-ui-stackbar": !0, "vue-data-ui-wrapper-fullscreen": ne.value }),
style: J(`background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color};font-family:${e.value.style.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`),
onMouseenter: r[6] || (r[6] = () => y(Ae)(!0)),
onMouseleave: r[7] || (r[7] = () => y(Ae)(!1))
}, [
e.value.userOptions.buttons.annotator ? (s(), q(y(_t), {
key: 0,
svgRef: y(De),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: de.value,
onClose: $e
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : g("", !0),
z(a.$slots, "userConfig", {}, void 0, !0),
e.value.style.chart.title.text ? (s(), n("div", {
key: 1,
ref_key: "chartTitle",
ref: Ne,
style: "width:100%;background:transparent;padding-bottom:24px"
}, [
(s(), q(xa, {
key: `title_${Ve.value}`,
config: {
title: {
cy: "stackbar-title",
...e.value.style.chart.title
},
subtitle: {
cy: "stackbar-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : g("", !0),
e.value.userOptions.show && Q.value && (y(Ue) || y(_e)) ? (s(), q(y(Mt), {
ref: "details",
key: `user_option_${Te.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: y(Be),
isImaging: y(We),
uid: V.value,
hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
hasPdf: e.value.userOptions.buttons.pdf,
hasImg: e.value.userOptions.buttons.img,
hasXls: e.value.userOptions.buttons.csv,
hasTable: e.value.userOptions.buttons.table,
hasLabel: e.value.userOptions.buttons.labels,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isFullscreen: ne.value,
chartElement: R.value,
position: e.value.userOptions.position,
isTooltip: L.value.showTooltip,
titles: { ...e.value.userOptions.buttonTitles },
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: de.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
onToggleFullscreen: et,
onGeneratePdf: y(Ye),
onGenerateCsv: st,
onGenerateImage: y(Xe),
onToggleTable: tt,
onToggleLabels: at,
onToggleTooltip: lt,
onToggleAnnotator: $e,
style: J({
visibility: y(Ue) ? y(_e) ? "visible" : "hidden" : "visible"
})
}, dt({ _: 2 }, [
a.$slots.menuIcon ? {
name: "menuIcon",
fn: _(({ isOpen: t, color: l }) => [
z(a.$slots, "menuIcon", F(E({ isOpen: t, color: l })), void 0, !0)
]),
key: "0"
} : void 0,
a.$slots.optionTooltip ? {
name: "optionTooltip",
fn: _(() => [
z(a.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
a.$slots.optionPdf ? {
name: "optionPdf",
fn: _(() => [
z(a.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
a.$slots.optionCsv ? {
name: "optionCsv",
fn: _(() => [
z(a.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
a.$slots.optionImg ? {
name: "optionImg",
fn: _(() => [
z(a.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
a.$slots.optionTable ? {
name: "optionTable",
fn: _(() => [
z(a.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
a.$slots.optionLabels ? {
name: "optionLabels",
fn: _(() => [
z(a.$slots, "optionLabels", {}, void 0, !0)
]),
key: "6"
} : void 0,
a.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: _(({ toggleFullscreen: t, isFullscreen: l }) => [
z(a.$slots, "optionFullscreen", F(E({ toggleFullscreen: t, isFullscreen: l })), void 0, !0)
]),
key: "7"
} : void 0,
a.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: _(({ toggleAnnotator: t, isAnnotator: l }) => [
z(a.$slots, "optionAnnotator", F(E({ toggleAnnotator: t, isAnnotator: l })), void 0, !0)
]),
key: "8"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : g("", !0),
Q.value ? (s(), n("svg", {
key: 3,
ref_key: "svgRef",
ref: De,
xmlns: y(oa),
viewBox: `0 0 ${o.value.chartWidth <= 0 ? 10 : o.value.chartWidth} ${o.value.chartHeight <= 0 ? 10 : o.value.chartHeight}`,
style: J(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
}, [
fe(y(Ct)),
a.$slots["chart-background"] ? (s(), n("foreignObject", {
key: 0,
x: o.value.left,
y: o.value.top,
width: o.value.width <= 0 ? 10 : o.value.width,
height: o.value.height <= 0 ? 10 : o.value.height,
style: {
pointerEvents: "none"
}
}, [
z(a.$slots, "chart-background", {}, void 0, !0)
], 8, Sa)) : g("", !0),
e.value.style.chart.bars.gradient.show ? (s(), n("defs", $a, [
(s(!0), n(v, null, f(k.value, (t, l) => (s(), n("linearGradient", {
id: `gradient_${t.id}`,
x1: "0%",
y1: "0%",
x2: "0%",
y2: "100%"
}, [
Z("stop", {
offset: "0%",
"stop-color": t.color
}, null, 8, Ta),
Z("stop", {
offset: "61.8%",
"stop-color": y(ia)(t.color, e.value.style.chart.bars.gradient.intensity / 100)
}, null, 8, Na),
Z("stop", {
offset: "100%",
"stop-color": t.color
}, null, 8, Ia)
], 8, Ma))), 256))
])) : g("", !0),
e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "vertical" ? (s(!0), n(v, { key: 2 }, f(P.value, (t, l) => (s(), n("line", {
x1: o.value.left,
x2: o.value.right,
y1: t.y,
y2: t.y,
stroke: e.value.style.chart.grid.x.linesColor,
"stroke-width": e.value.style.chart.grid.x.linesThickness,
"stroke-dasharray": e.value.style.chart.grid.x.linesStrokeDasharray,
"stroke-linecap": "round"
}, null, 8, Pa))), 256)) : g("", !0),
e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (s(!0), n(v, { key: 3 }, f(h.value.end - h.value.start + 1, (t, l) => (s(), n("line", {
x1: o.value.left,
x2: o.value.right,
y1: o.value.top + d.value * l,
y2: o.value.top + d.value * l,
stroke: e.value.style.chart.grid.x.linesColor,
"stroke-width": e.value.style.chart.grid.x.linesThickness,
"stroke-dasharray": e.value.style.chart.grid.x.linesStrokeDasharray,
"stroke-linecap": "round"
}, null, 8, Oa))), 256)) : g("", !0),
e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "vertical" ? (s(!0), n(v, { key: 4 }, f(h.value.end - h.value.start + 1, (t, l) => (s(), n("line", {
x1: o.value.left + d.value * l,
x2: o.value.left + d.value * l,
y1: o.value.top,
y2: o.value.bottom,
stroke: e.value.style.chart.grid.y.linesColor,
"stroke-width": e.value.style.chart.grid.y.linesThickness,
"stroke-dasharray": e.value.style.chart.grid.y.linesStrokeDasharray,
"stroke-linecap": "round"
}, null, 8, Ra))), 256)) : g("", !0),
e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "horizontal" ? (s(!0), n(v, { key: 5 }, f(P.value, (t, l) => (s(), n("line", {
x1: t.horizontal_x,
x2: t.horizontal_x,
y1: o.value.top,
y2: o.value.bottom,
stroke: e.value.style.chart.grid.y.linesColor,
"stroke-width": e.value.style.chart.grid.y.linesThickness,
"stroke-dasharray": e.value.style.chart.grid.y.linesStrokeDasharray,
"stroke-linecap": "round"
}, null, 8, Va))), 256)) : g("", !0),
(s(!0), n(v, null, f(k.value, (t, l) => (s(), n("g", null, [
a.$slots.pattern ? (s(), n("defs", Aa, [
z(a.$slots, "pattern", Me({ ref_for: !0 }, { seriesIndex: t.absoluteIndex, patternId: `pattern_${V.value}_${t.absoluteIndex}` }), void 0, !0)
])) : g("", !0),
e.value.orientation === "vertical" ? (s(), n(v, { key: 1 }, [
(s(!0), n(v, null, f(t.x, (c, u) => (s(), n("rect", {
x: c,
y: t.y[u] < 0 ? 0 : t.y[u],
height: t.height[u] < 0 ? 1e-4 : t.height[u] || 0,
rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
stroke: e.value.style.chart.backgroundColor,
"stroke-width": e.value.style.chart.bars.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round",
class: oe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": H.value })
}, null, 10, Ua))), 256)),
a.$slots.pattern ? (s(), n("g", Da, [
(s(!0), n(v, null, f(t.x, (c, u) => (s(), n("rect", {
x: c,
y: t.y[u] < 0 ? 0 : t.y[u],
height: t.height[u] < 0 ? 1e-4 : t.height[u] || 0,
rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
fill: `url(#pattern_${V.value}_${t.absoluteIndex})`,
stroke: e.value.style.chart.backgroundColor,
"stroke-width": e.value.style.chart.bars.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round",
class: oe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": H.value })
}, null, 10, Fa))), 256))
])) : g("", !0)
], 64)) : (s(), n(v, { key: 2 }, [
(s(!0), n(v, null, f(t.horizontal_x, (c, u) => (s(), n("rect", {
x: y(xe)(c, o.value.left),
y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
width: y(xe)(t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]),
rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
height: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
stroke: e.value.style.chart.backgroundColor,
"stroke-width": e.value.style.chart.bars.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round",
class: oe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": H.value })
}, null, 10, Ea))), 256)),
a.$slots.pattern ? (s(), n("g", Ha, [
(s(!0), n(v, null, f(t.horizontal_x, (c, u) => (s(), n("rect", {
x: y(xe)(c, o.value.left),
y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
width: y(xe)(t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]),
rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
height: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
fill: `url(#pattern_${V.value}_${t.absoluteIndex})`,
stroke: e.value.style.chart.backgroundColor,
"stroke-width": e.value.style.chart.bars.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round",
class: oe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": H.value })
}, null, 10, Ba))), 256))
])) : g("", !0)
], 64))
]))), 256)),
e.value.style.chart.grid.x.showAxis ? (s(), n("line", {
key: 6,
x1: o.value.left,
x2: o.value.right,
y1: o.value.bottom,
y2: o.value.bottom,
stroke: e.value.style.chart.grid.x.axisColor,
"stroke-width": e.value.style.chart.grid.x.axisThickness,
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, null, 8, Wa)) : g("", !0),
e.value.style.chart.grid.y.showAxis && !e.value.style.chart.bars.distributed ? (s(), n("line", {
key: 7,
x1: o.value.left,
x2: o.value.left,
y1: o.value.top,
y2: o.value.bottom,
stroke: e.value.style.chart.grid.y.axisColor,
"stroke-width": e.value.style.chart.grid.y.axisThickness,
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, null, 8, Ya)) : g("", !0),
e.value.style.chart.grid.x.axisName.show && e.value.style.chart.grid.x.axisName.text ? (s(), n("text", {
key: 8,
x: o.value.left + o.value.width / 2,
y: o.value.chartHeight + e.value.style.chart.grid.x.axisName.offsetY,
"font-size": e.value.style.chart.grid.x.axisName.fontSize,
fill: e.value.style.chart.grid.x.axisName.color,
"font-weight": e.value.style.chart.grid.x.axisName.bold ? "bold" : "normal",
"text-anchor": "middle"
}, T(e.value.style.chart.grid.x.axisName.text), 9, Xa)) : g("", !0),
e.value.style.chart.grid.y.axisName.show && e.value.style.chart.grid.y.axisName.text ? (s(), n("text", {
key: 9,
transform: `translate(${e.value.style.chart.grid.y.axisName.fontSize + e.value.style.chart.grid.y.axisName.offsetX}, ${o.value.top + o.value.height / 2}) rotate(-90)`,
"font-size": e.value.style.chart.grid.y.axisName.fontSize,
fill: e.value.style.chart.grid.y.axisName.color,
"font-weight": e.value.style.chart.grid.y.axisName.bold ? "bold" : "normal",
"text-anchor": "middle"
}, T(e.value.style.chart.grid.y.axisName.text), 9, Ga)) : g("", !0),
L.value.dataLabels.show && e.value.orientation === "vertical" ? (s(), n(v, { key: 10 }, [
(s(!0), n(v, null, f(k.value, (t, l) => (s(), n("g", null, [
(s(!0), n(v, null, f(t.x, (c, u) => (s(), n(v, null, [
it(t.series[u], t.proportions[u]) ? (s(), n("text", {
key: 0,
x: c + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2,
y: t.y[u] + t.height[u] / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
"font-size": e.value.style.chart.bars.dataLabels.fontSize,
fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? y(mt)(t.color) : e.value.style.chart.bars.dataLabels.color,
"font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
"text-anchor": "middle"
}, T(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Ke(t.proportions[u] * 100, t, l, u) : he(t.series[u], t, l, u, t.signedSeries[u])), 9, Ja)) : g("", !0)
], 64))), 256))
]))), 256)),
e.value.style.chart.bars.totalValues.show && k.value.length > 1 ? (s(), n("g", qa, [
(s(!0), n(v, null, f(Ze.value, (t, l) => (s(), n(v, null, [
!e.value.style.chart.bars.dataLabels.hideEmptyValues || t.value !== 0 ? (s(), n("text", {
key: 0,
x: o.value.left + d.value * l + d.value / 2,
y: o.value.top - e.value.style.chart.bars.totalValues.fontSize / 3,
"text-anchor": "middle",
"font-size": e.value.style.chart.bars.totalValues.fontSize,
"font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
fill: e.value.style.chart.bars.totalValues.color
}, T(he(t.value, t, l, t.sign)), 9, Za)) : g("", !0)
], 64))), 256))
])) : g("", !0)
], 64)) : g("", !0),
L.value.dataLabels.show && e.value.orientation === "horizontal" ? (s(), n(v, { key: 11 }, [
(s(!0), n(v, null, f(k.value, (t, l) => (s(), n("g", null, [
(s(!0), n(v, null, f(t.horizontal_x, (c, u) => (s(), n(v, null, [
it(t.series[u], t.proportions[u]) ? (s(), n("text", {
key: 0,
x: c + (t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]) / 2,
y: t.horizontal_y[u] + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
"font-size": e.value.style.chart.bars.dataLabels.fontSize,
fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? y(mt)(t.color) : e.value.style.chart.bars.dataLabels.color,
"font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
"text-anchor": "middle"
}, T(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Ke(t.proportions[u] * 100, t, l, u) : he(t.series[u], t, l, u, t.signedSeries[u])), 9, Ka)) : g("", !0)
], 64))), 256))
]))), 256)),
e.value.style.chart.bars.totalValues.show && k.value.length > 1 ? (s(), n("g", Qa, [
(s(!0), n(v, null, f(Ze.value, (t, l) => (s(), n(v, null, [
!e.value.style.chart.bars.dataLabels.hideEmptyValues || t.value !== 0 ? (s(), n("text", {
key: 0,
x: o.value.right + e.value.style.chart.bars.totalValues.fontSize / 3,
y: o.value.top + d.value * l + d.value / 2,
"text-anchor": "start",
"font-size": e.value.style.chart.bars.totalValues.fontSize,
"font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
fill: e.value.style.chart.bars.totalValues.color
}, T(he(t.value, t, l, t.sign)), 9, ja)) : g("", !0)
], 64))), 256))
])) : g("", !0)
], 64)) : g("", !0),
e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "vertical" ? (s(), n(v, { key: 12 }, [
(s(!0), n(v, null, f(P.value, (t, l) => (s(), n("line", {
x1: o.value.left,
x2: o.value.left - 6,
y1: t.y,
y2: t.y,
stroke: e.value.style.chart.grid.x.axisColor,
"stroke-width": 1
}, null, 8, el))), 256)),
(s(!0), n(v, null, f(P.value, (t, l) => (s(), n("text", {
x: t.x,
y: t.y + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
"font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
"font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
fill: e.value.style.chart.grid.y.axisLabels.color,
"text-anchor": "end"
}, T(y(ke)(
e.value.style.chart.grid.y.axisLabels.formatter,
t.value,
y(K)({
p: e.value.style.chart.bars.dataLabels.prefix,
v: t.value,
s: e.value.style.chart.bars.dataLabels.suffix,
r: e.value.style.chart.grid.y.axisLabels.rounding
}),
{ datapoint: t }
)), 9, tl))), 256))
], 64)) : g("", !0),
e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "horizontal" ? (s(), n(v, { key: 13 }, [
(s(!0), n(v, null, f(P.value, (t, l) => (s(), n("line", {
x1: t.horizontal_x,
x2: t.horizontal_x,
y1: o.value.bottom,
y2: o.value.bottom + 6,
stroke: e.value.style.chart.grid.x.axisColor,
"stroke-width": 1,
"stroke-linecap": "round"
}, null, 8, al))), 256)),
(s(!0), n(v, null, f(P.value, (t, l) => (s(), n("text", {
"font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
"font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
fill: e.value.style.chart.grid.y.axisLabels.color,
"text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
transform: `translate(${t.horizontal_x}, ${o.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`
}, T(y(ke)(
e.value.style.chart.grid.y.axisLabels.formatter,
t.value,
y(K)({
p: e.value.style.chart.bars.dataLabels.prefix,
v: t.value,
s: e.value.style.chart.bars.dataLabels.suffix,
r: e.value.style.chart.grid.y.axisLabels.rounding
}),
{ datapoint: t }
)), 9, ll))), 256))
], 64)) : g("", !0),
e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "vertical" ? (s(), n(v, { key: 14 }, [
a.$slots["time-label"] ? (s(), n("g", rl, [
(s(!0), n(v, null, f($.value, (t, l) => (s(), n("g", null, [
z(a.$slots, "time-label", Me({ ref_for: !0 }, {
x: o.value.left + d.value * l + d.value / 2,
y: o.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY,
fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
fill: e.value.style.chart.grid.x.timeLabels.color,
transform: `translate(${o.value.left + d.value * l + d.value / 2}, ${o.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate