vue-data-ui 3.0.0-next.2 → 3.0.0-next.21

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.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/{Arrow-Dck2Ea5K.js → Arrow-C3yKQTJs.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CatHZ1ns.js → BaseDraggableDialog-B2wP_11m.js} +2 -2
  4. package/dist/{BaseIcon-BmZ4MREl.js → BaseIcon-_brgsjLG.js} +1 -1
  5. package/dist/{useLoading-Bt5Doa8m.js → BaseScanner-DIK2NTdp.js} +11 -11
  6. package/dist/{ColorPicker-C1MXyD9Q.js → ColorPicker-CCG8G1nd.js} +2 -2
  7. package/dist/{DataTable-CgL0Rz0x.js → DataTable-C3ve--z6.js} +2 -2
  8. package/dist/{Legend-CYbP3Kfg.js → Legend-CX874XJp.js} +2 -2
  9. package/dist/{NonSvgPenAndPaper-CcbcJm_U.js → NonSvgPenAndPaper-CnTtK3iB.js} +3 -3
  10. package/dist/{PackageVersion-CAkNkiIG.js → PackageVersion-5l2M4Zh4.js} +1 -1
  11. package/dist/{PenAndPaper-Cx1-5zdD.js → PenAndPaper-CYEXrj4q.js} +3 -3
  12. package/dist/{Shape-DBXkGxKt.js → Shape-Du8dC9QE.js} +1 -1
  13. package/dist/{Slicer-nrMi5hzj.js → Slicer-D06CTSaX.js} +2 -2
  14. package/dist/{SparkTooltip-fNzL4pIU.js → SparkTooltip-DcX30xns.js} +1 -1
  15. package/dist/{Title-pVYRzQXY.js → Title-CItmidxn.js} +1 -1
  16. package/dist/{Tooltip-NwATo4ZJ.js → Tooltip-lhQXI9xT.js} +1 -1
  17. package/dist/{UserOptions-DAsRxxrf.js → UserOptions-mGHinyKk.js} +2 -2
  18. package/dist/{dom-to-png-BF_4H_6u.js → dom-to-png-juWKTR2G.js} +1 -1
  19. package/dist/{img-ku4zevVD.js → img-2Cyzq02w.js} +1 -1
  20. package/dist/{index-BzfnuLnw.js → index-DyWXkFFm.js} +799 -735
  21. package/dist/{pdf-CguiIsUc.js → pdf-C9bVIzob.js} +1 -1
  22. package/dist/style.css +1 -1
  23. package/dist/types/vue-data-ui.d.cts +113 -15
  24. package/dist/types/vue-data-ui.d.ts +113 -15
  25. package/dist/{useNestedProp-DorElw91.js → useNestedProp-5rJrnAmD.js} +1 -1
  26. package/dist/{usePrinter-C9qkgv0r.js → usePrinter-YV36Zq2L.js} +2 -2
  27. package/dist/useTimeLabelCollider-V7AOiPLB.js +71 -0
  28. package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DFkUfjfs.js} +211 -152
  29. package/dist/{vue-data-ui-DQef_oFO.js → vue-data-ui-Br6XzNcY.js} +80 -74
  30. package/dist/vue-data-ui.js +54 -52
  31. package/dist/{vue-ui-3d-bar-DPSamIA-.js → vue-ui-3d-bar-BeZ4UXj1.js} +6 -6
  32. package/dist/{vue-ui-accordion-DgZK-qDz.js → vue-ui-accordion-_T76roov.js} +3 -3
  33. package/dist/{vue-ui-age-pyramid-DVeGKvf9.js → vue-ui-age-pyramid-DyILZmL1.js} +6 -6
  34. package/dist/{vue-ui-annotator-6ikkK-FK.js → vue-ui-annotator-D6vtgVKu.js} +2 -2
  35. package/dist/{vue-ui-bullet-Bg4hfFk2.js → vue-ui-bullet-CRL0nm0H.js} +7 -7
  36. package/dist/vue-ui-candlestick-Lv87ukLK.js +973 -0
  37. package/dist/{vue-ui-carousel-table-DitKhrFT.js → vue-ui-carousel-table-bQiT7iYL.js} +4 -4
  38. package/dist/{vue-ui-chestnut-D8wGAZod.js → vue-ui-chestnut-CshEgUb5.js} +5 -5
  39. package/dist/{vue-ui-chord-C-uTVCDP.js → vue-ui-chord-C_Gurj0k.js} +8 -8
  40. package/dist/{vue-ui-circle-pack-CPy6xcxv.js → vue-ui-circle-pack-DcDbc0cs.js} +6 -6
  41. package/dist/{vue-ui-cursor-Dd7vUd0q.js → vue-ui-cursor-BlANSWeT.js} +2 -2
  42. package/dist/{vue-ui-dashboard-CKurbu8M.js → vue-ui-dashboard-Dylth91b.js} +62 -62
  43. package/dist/{vue-ui-digits-DfdZI11G.js → vue-ui-digits-BISvEvKG.js} +2 -2
  44. package/dist/{vue-ui-donut-tECBFvud.js → vue-ui-donut-DJYRCCLe.js} +416 -401
  45. package/dist/{vue-ui-donut-evolution-CKbLO8yR.js → vue-ui-donut-evolution--nHID422.js} +9 -9
  46. package/dist/{vue-ui-dumbbell-DI5Lj3r_.js → vue-ui-dumbbell-CsZa3YKC.js} +7 -7
  47. package/dist/{vue-ui-flow-CjU48s9z.js → vue-ui-flow-D1YZHLf1.js} +7 -7
  48. package/dist/{vue-ui-funnel-DM_5vHZ4.js → vue-ui-funnel-KScJM0Sk.js} +6 -6
  49. package/dist/{vue-ui-galaxy-ocvZgZJx.js → vue-ui-galaxy-7I6nMU7k.js} +5 -5
  50. package/dist/{vue-ui-gauge-DajNoY-D.js → vue-ui-gauge-BWOeGXdp.js} +6 -6
  51. package/dist/{vue-ui-gizmo-DTnzeQbm.js → vue-ui-gizmo-C7Oci8xf.js} +3 -3
  52. package/dist/{vue-ui-heatmap-CfBS8jQe.js → vue-ui-heatmap-CeQq5YFh.js} +7 -7
  53. package/dist/{vue-ui-history-plot-BuOPWQoP.js → vue-ui-history-plot-C1R46zuZ.js} +7 -7
  54. package/dist/{vue-ui-kpi-DLGHOIRj.js → vue-ui-kpi-CXXCCBoi.js} +3 -3
  55. package/dist/{vue-ui-mini-loader-CHAHi4c9.js → vue-ui-mini-loader-BDeMu-HG.js} +2 -2
  56. package/dist/{vue-ui-molecule-R5-oDFeW.js → vue-ui-molecule-BG_Vm9Z-.js} +5 -5
  57. package/dist/{vue-ui-mood-radar-Ddf2gaES.js → vue-ui-mood-radar-68rvpqSe.js} +7 -7
  58. package/dist/vue-ui-nested-donuts-y7DnbLj7.js +1282 -0
  59. package/dist/{vue-ui-onion-D2n4zUkV.js → vue-ui-onion-cpCWH8CY.js} +7 -7
  60. package/dist/{vue-ui-parallel-coordinate-plot-CNWQqlxf.js → vue-ui-parallel-coordinate-plot-AXeySjsk.js} +8 -8
  61. package/dist/{vue-ui-quadrant-CxNj2FEx.js → vue-ui-quadrant-9-wXsL9m.js} +8 -8
  62. package/dist/{vue-ui-quick-chart-Bm_VmhJR.js → vue-ui-quick-chart-B_SOReEM.js} +7 -7
  63. package/dist/{vue-ui-radar-DSYMQJ6K.js → vue-ui-radar-BryqHi8h.js} +7 -7
  64. package/dist/{vue-ui-rating-BiQpwXnc.js → vue-ui-rating-Cm4WHdIj.js} +2 -2
  65. package/dist/{vue-ui-relation-circle-Cdxe78Bm.js → vue-ui-relation-circle-D-wNj3HG.js} +6 -6
  66. package/dist/{vue-ui-ridgeline-DpeM2hRi.js → vue-ui-ridgeline-B5y-Z_xt.js} +9 -9
  67. package/dist/{vue-ui-rings-BenmQHKv.js → vue-ui-rings-D-TtSoDJ.js} +8 -8
  68. package/dist/{vue-ui-scatter-mDMY1H6U.js → vue-ui-scatter-DzPgW23k.js} +8 -8
  69. package/dist/{vue-ui-skeleton-Ch_XkFuP.js → vue-ui-skeleton-QZs3A3_K.js} +3 -3
  70. package/dist/{vue-ui-smiley-DTig5lTU.js → vue-ui-smiley-ka3aFa0e.js} +2 -2
  71. package/dist/{vue-ui-spark-trend-BkDsp8E0.js → vue-ui-spark-trend-CJhdQ9Ls.js} +3 -3
  72. package/dist/{vue-ui-sparkbar-CgqoyBOm.js → vue-ui-sparkbar-CL5ZGdHd.js} +3 -3
  73. package/dist/{vue-ui-sparkgauge-B4jR_Y62.js → vue-ui-sparkgauge-C5Jdp3zp.js} +3 -3
  74. package/dist/{vue-ui-sparkhistogram-DfxjglLy.js → vue-ui-sparkhistogram-CHRRpkm0.js} +4 -4
  75. package/dist/{vue-ui-sparkline-M3QR8xJE.js → vue-ui-sparkline-B0r89-4E.js} +3 -3
  76. package/dist/{vue-ui-sparkstackbar-B2Ls-Mb8.js → vue-ui-sparkstackbar-l35guX1R.js} +3 -3
  77. package/dist/vue-ui-stackbar-AKs4GMxY.js +1354 -0
  78. package/dist/{vue-ui-strip-plot-B_ZLbu2D.js → vue-ui-strip-plot-uhUjZcif.js} +7 -7
  79. package/dist/{vue-ui-table-BhymhDOh.js → vue-ui-table-BbRxUiDQ.js} +3 -3
  80. package/dist/{vue-ui-table-heatmap-DokRh4dS.js → vue-ui-table-heatmap-CVdmaPTJ.js} +5 -5
  81. package/dist/{vue-ui-table-sparkline-DxBZGKZJ.js → vue-ui-table-sparkline-DJfVAI5W.js} +4 -4
  82. package/dist/{vue-ui-thermometer-e2L6IdF-.js → vue-ui-thermometer-BYx0gV05.js} +6 -6
  83. package/dist/{vue-ui-timer-BG2EwK3o.js → vue-ui-timer-DL2v49kR.js} +5 -5
  84. package/dist/{vue-ui-tiremarks-nzQH7woJ.js → vue-ui-tiremarks-LlgdqzTU.js} +6 -6
  85. package/dist/{vue-ui-treemap-CZxyi6fl.js → vue-ui-treemap-B2v9uGdI.js} +8 -8
  86. package/dist/vue-ui-vertical-bar-DSCAkzDF.js +1106 -0
  87. package/dist/{vue-ui-waffle-D399D4UE.js → vue-ui-waffle-DmNJRK-_.js} +8 -8
  88. package/dist/{vue-ui-wheel-DtcwtHzJ.js → vue-ui-wheel-ChRAwecI.js} +6 -6
  89. package/dist/{vue-ui-word-cloud-CTDceQsf.js → vue-ui-word-cloud-CELkzbyr.js} +6 -6
  90. package/dist/{vue-ui-world-BjNSbqMZ.js → vue-ui-world-BOJa-cTu.js} +6 -6
  91. package/dist/vue-ui-xy-DfeP_T81.js +3000 -0
  92. package/dist/{vue-ui-xy-canvas-BKAowbe0.js → vue-ui-xy-canvas-Dijs3J4M.js} +9 -9
  93. package/package.json +1 -1
  94. package/dist/vue-ui-candlestick-Bi59FGXn.js +0 -873
  95. package/dist/vue-ui-nested-donuts-CksklV83.js +0 -1177
  96. package/dist/vue-ui-stackbar-DIHkn6__.js +0 -1207
  97. package/dist/vue-ui-vertical-bar-DahdX1Sn.js +0 -980
  98. package/dist/vue-ui-xy-BkTP-JpK.js +0 -2958
@@ -0,0 +1,1354 @@
1
+ import { defineAsyncComponent as ae, useSlots as ga, computed as k, ref as b, onMounted as zt, toRefs as ba, watch as Fe, shallowRef as Ct, onBeforeUnmount as St, watchEffect as _t, nextTick as Le, createElementBlock as o, openBlock as s, unref as v, normalizeStyle as Z, normalizeClass as le, createBlock as K, createCommentVNode as y, renderSlot as L, createElementVNode as Q, createVNode as ze, createSlots as $t, withCtx as C, normalizeProps as U, guardReactiveProps as H, Fragment as g, renderList as m, mergeProps as Ue, toDisplayString as M, createTextVNode as fa } from "vue";
2
+ import { u as ma, c as Tt, A as pa, t as xa, p as Ce, a as ka, C as re, b as wa, o as Mt, e as At, g as La, d as za, am as Se, ab as Nt, D as It, X as Ca, l as Sa, aa as _e, F as Rt, i as $e, f as j, I as _a, a0 as $a, x as Ot, q as Ta, r as Ma, y as Aa } from "./index-DyWXkFFm.js";
3
+ import { u as Pt } from "./useNestedProp-5rJrnAmD.js";
4
+ import { t as He, u as Na } from "./useResponsive-DfdjqQps.js";
5
+ import { u as Ia } from "./usePrinter-YV36Zq2L.js";
6
+ import { u as Ra } from "./useUserOptionState-BIvW1Kz7.js";
7
+ import { u as Oa } from "./useChartAccessibility-9icAAmYg.js";
8
+ import { u as Pa } from "./useTimeLabelCollider-V7AOiPLB.js";
9
+ import Va from "./Legend-CX874XJp.js";
10
+ import { S as Ea } from "./Slicer-D06CTSaX.js";
11
+ import Da from "./Title-CItmidxn.js";
12
+ import { _ as Fa } from "./Shape-Du8dC9QE.js";
13
+ import { u as Ua } from "./useTimeLabels-DFkUfjfs.js";
14
+ import Ha from "./img-2Cyzq02w.js";
15
+ import { u as Ba, B as Wa } from "./BaseScanner-DIK2NTdp.js";
16
+ import { _ as Ya } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
+ const Xa = ["id"], Ga = ["xmlns", "viewBox"], Ja = ["x", "y", "width", "height"], qa = { key: 1 }, Za = ["id"], Ka = ["stop-color"], Qa = ["stop-color"], ja = ["stop-color"], el = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], tl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], al = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ll = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], rl = { key: 0 }, sl = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], ol = { key: 0 }, il = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], nl = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ul = { key: 0 }, cl = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], hl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], dl = ["x", "y", "font-size", "fill", "font-weight"], yl = ["transform", "font-size", "fill", "font-weight"], gl = ["x", "y", "font-size", "fill", "font-weight"], bl = ["x", "y", "font-size", "font-weight", "fill"], fl = ["x", "y", "font-size", "fill", "font-weight"], ml = ["x", "y", "font-size", "font-weight", "fill"], pl = ["x1", "x2", "y1", "y2", "stroke"], xl = ["x", "y", "font-size", "font-weight", "fill"], kl = ["x1", "x2", "y1", "y2", "stroke"], wl = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ll = { key: 0 }, zl = { key: 1 }, Cl = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Sl = ["text-anchor", "font-size", "fill", "transform", "innerHTML", "onClick"], _l = { key: 0 }, $l = { key: 1 }, Tl = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ml = ["font-size", "font-weight", "fill", "x", "y", "onClick", "innerHTML"], Al = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Nl = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Il = {
18
+ key: 3,
19
+ class: "vue-data-ui-watermark"
20
+ }, Rl = ["onClick"], Ol = ["innerHTML"], Pl = {
21
+ __name: "vue-ui-stackbar",
22
+ props: {
23
+ config: {
24
+ type: Object,
25
+ default() {
26
+ return {};
27
+ }
28
+ },
29
+ dataset: {
30
+ type: Array,
31
+ default() {
32
+ return [];
33
+ }
34
+ }
35
+ },
36
+ emits: ["selectDatapoint", "selectLegend", "selectTimeLabel"],
37
+ setup(Te, { expose: Vt, emit: Et }) {
38
+ const Dt = ae(() => import("./vue-ui-accordion-_T76roov.js")), Ft = ae(() => import("./DataTable-C3ve--z6.js")), Ut = ae(() => import("./PackageVersion-5l2M4Zh4.js")), Ht = ae(() => import("./PenAndPaper-CYEXrj4q.js")), Bt = ae(() => import("./Tooltip-lhQXI9xT.js")), Wt = ae(() => import("./UserOptions-mGHinyKk.js")), { vue_ui_stackbar: Yt } = ma(), Xt = ga(), f = Te, Me = Et, ne = k({
39
+ get() {
40
+ return !!f.dataset && f.dataset.length;
41
+ },
42
+ set(a) {
43
+ return a;
44
+ }
45
+ }), P = b(null), V = b(Tt()), ue = b(!1), Ae = b(null), Ne = b(""), _ = b([]), Be = b(0), We = b(null), Ye = b(null), Xe = b(null), Ge = b(null), Je = b(0), ce = b(!1), se = b(null), B = b(!1), qe = b(0), Gt = b(0), Jt = b(0), ee = b(null), Ie = b(null), Re = b(null), W = b(null), Y = b(null), qt = b(null), Ze = b(null);
46
+ zt(() => {
47
+ Ee();
48
+ });
49
+ const e = b(Pe()), { loading: he, FINAL_DATASET: ve, manualLoading: de } = Ba({
50
+ ...ba(f),
51
+ FINAL_CONFIG: e,
52
+ prepareConfig: Pe,
53
+ skeletonDataset: [
54
+ {
55
+ name: "",
56
+ series: [2, 3, 5, 8, 13, 21],
57
+ color: "#BABABA"
58
+ },
59
+ {
60
+ name: "",
61
+ series: [1, 2, 3, 5, 8, 13],
62
+ color: "#CACACA"
63
+ }
64
+ ],
65
+ skeletonConfig: pa({
66
+ defaultConfig: e.value,
67
+ userConfig: {
68
+ userOptions: { show: !1 },
69
+ useCssAnimation: !1,
70
+ table: { show: !1 },
71
+ tooltip: { show: !1 },
72
+ style: {
73
+ chart: {
74
+ backgroundColor: "#99999930",
75
+ bars: {
76
+ totalValues: { show: !1 },
77
+ dataLabels: { show: !1 }
78
+ },
79
+ grid: {
80
+ scale: {
81
+ scaleMin: 0,
82
+ scaleMax: 40
83
+ },
84
+ x: {
85
+ axisColor: "#6A6A6A",
86
+ linesColor: "#6A6A6A",
87
+ axisName: { show: !1 },
88
+ timeLabels: { show: !1 }
89
+ },
90
+ y: {
91
+ axisColor: "#6A6A6A",
92
+ linesColor: "#6A6A6A",
93
+ axisName: { show: !1 },
94
+ axisLabels: { show: !1 }
95
+ }
96
+ },
97
+ legend: {
98
+ backgroundColor: "transparent"
99
+ },
100
+ padding: {
101
+ left: 24,
102
+ right: 24,
103
+ bottom: 12
104
+ },
105
+ zoom: {
106
+ show: !1,
107
+ startIndex: null,
108
+ endIndex: null
109
+ }
110
+ }
111
+ }
112
+ }
113
+ })
114
+ }), { userOptionsVisible: Oe, setUserOptionsVisibility: Ke, keepUserOptionState: Qe } = Ra({ config: e.value }), { svgRef: je } = Oa({ config: e.value.style.chart.title });
115
+ function Pe() {
116
+ const a = Pt({
117
+ userConfig: f.config,
118
+ defaultConfig: Yt
119
+ });
120
+ let r = {};
121
+ return a.theme ? r = {
122
+ ...Pt({
123
+ userConfig: ka.vue_ui_stackbar[a.theme] || f.config,
124
+ defaultConfig: a
125
+ }),
126
+ customPalette: xa[a.theme] || Ce
127
+ } : r = a, f.config && re(f.config, "style.chart.grid.scale.scaleMin") ? r.style.chart.grid.scale.scaleMin = f.config.style.chart.grid.scale.scaleMin : r.style.chart.grid.scale.scaleMin = null, f.config && re(f.config, "style.chart.grid.scale.scaleMax") ? r.style.chart.grid.scale.scaleMax = f.config.style.chart.grid.scale.scaleMax : r.style.chart.grid.scale.scaleMax = null, f.config && re(f.config, "style.chart.zoom.startIndex") ? r.style.chart.zoom.startIndex = f.config.style.chart.zoom.startIndex : r.style.chart.zoom.startIndex = null, f.config && re(f.config, "style.chart.zoom.endIndex") ? r.style.chart.zoom.endIndex = f.config.style.chart.zoom.endIndex : r.style.chart.zoom.endIndex = null, f.config && re(f.config, "style.chart.bars.dataLabels.hideUnderValue") ? r.style.chart.bars.dataLabels.hideUnderValue = f.config.style.chart.bars.dataLabels.hideUnderValue : r.style.chart.bars.dataLabels.hideUnderValue = null, f.config && re(f.config, "style.chart.bars.dataLabels.hideUnderPercentage") ? r.style.chart.bars.dataLabels.hideUnderPercentage = f.config.style.chart.bars.dataLabels.hideUnderPercentage : r.style.chart.bars.dataLabels.hideUnderPercentage = null, r;
128
+ }
129
+ const et = k(() => e.value.style.chart.bars.dataLabels.hideUnderValue !== null), tt = k(() => e.value.style.chart.bars.dataLabels.hideUnderPercentage !== null);
130
+ Fe(() => f.config, (a) => {
131
+ he.value || (e.value = Pe()), Oe.value = !e.value.userOptions.showOnChartHover, Ee(), qe.value += 1, Gt.value += 1, Jt.value += 1, z.value.dataLabels.show = e.value.style.chart.bars.dataLabels.show, z.value.showTable = e.value.table.show, z.value.showTooltip = e.value.style.chart.tooltip.show;
132
+ }, { deep: !0 }), Fe(() => f.dataset, (a) => {
133
+ Array.isArray(a) && a.length > 0 && (de.value = !1), nt();
134
+ }, { deep: !0 });
135
+ const z = b({
136
+ dataLabels: {
137
+ show: e.value.style.chart.bars.dataLabels.show
138
+ },
139
+ showTable: e.value.table.show,
140
+ showTooltip: e.value.style.chart.tooltip.show
141
+ });
142
+ Fe(e, () => {
143
+ z.value = {
144
+ dataLabels: {
145
+ show: e.value.style.chart.bars.dataLabels.show
146
+ },
147
+ showTable: e.value.table.show,
148
+ showTooltip: e.value.style.chart.tooltip.show
149
+ };
150
+ }, { immediate: !0 });
151
+ const { isPrinting: at, isImaging: lt, generatePdf: rt, generateImage: st } = Ia({
152
+ elementId: `stackbar_${V.value}`,
153
+ fileName: e.value.style.chart.title.text || "vue-ui-stackbar",
154
+ options: e.value.userOptions.print
155
+ }), ye = b({
156
+ width: e.value.style.chart.width,
157
+ height: e.value.style.chart.height,
158
+ paddingRatio: {
159
+ top: e.value.style.chart.padding.top / e.value.style.chart.height,
160
+ right: e.value.style.chart.padding.right / e.value.style.chart.width,
161
+ bottom: e.value.style.chart.padding.bottom / e.value.style.chart.height,
162
+ left: e.value.style.chart.padding.left / e.value.style.chart.width
163
+ }
164
+ }), Zt = k(() => wa(e.value.customPalette)), E = Ct(null), te = Ct(null), ot = b(null);
165
+ zt(() => {
166
+ Ee();
167
+ });
168
+ const Ve = k(() => !!e.value.debug);
169
+ function Ee() {
170
+ if (Mt(f.dataset) ? (At({
171
+ componentName: "VueUiStackbar",
172
+ type: "dataset",
173
+ debug: Ve.value
174
+ }), de.value = !0) : f.dataset.forEach((a, r) => {
175
+ La({
176
+ datasetObject: a,
177
+ requiredAttributes: ["name", "series"]
178
+ }).forEach((t) => {
179
+ ne.value = !1, At({
180
+ componentName: "VueUiStackbar",
181
+ type: "datasetSerieAttribute",
182
+ property: t,
183
+ index: r,
184
+ debug: Ve.value
185
+ }), de.value = !0;
186
+ });
187
+ }), Mt(f.dataset) || (de.value = e.value.loading), setTimeout(() => {
188
+ B.value = !0;
189
+ }, 10), e.value.responsive) {
190
+ const a = He(() => {
191
+ B.value = !1;
192
+ const { width: r, height: t } = Na({
193
+ chart: P.value,
194
+ title: e.value.style.chart.title.text ? We.value : null,
195
+ legend: e.value.style.chart.legend.show ? Ye.value : null,
196
+ slicer: e.value.style.chart.zoom.show && F.value > 1 ? Xe.value : null,
197
+ source: Ge.value
198
+ });
199
+ requestAnimationFrame(() => {
200
+ ye.value.width = r, ye.value.height = t - 12, clearTimeout(ot.value), ot.value = setTimeout(() => {
201
+ B.value = !0;
202
+ }, 10);
203
+ });
204
+ });
205
+ E.value && (te.value && E.value.unobserve(te.value), E.value.disconnect()), E.value = new ResizeObserver(a), te.value = P.value.parentNode, E.value.observe(te.value);
206
+ }
207
+ ut();
208
+ }
209
+ St(() => {
210
+ E.value && (te.value && E.value.unobserve(te.value), E.value.disconnect());
211
+ });
212
+ function Kt() {
213
+ let a = 0;
214
+ e.value.orientation === "vertical" && W.value && (a = Array.from(W.value.querySelectorAll("text")).reduce((l, c) => {
215
+ const u = c.getComputedTextLength();
216
+ return u > l ? u : l;
217
+ }, 0)), e.value.orientation === "horizontal" && Y.value && (a = Array.from(Y.value.querySelectorAll("text")).reduce((l, c) => {
218
+ const u = c.getComputedTextLength();
219
+ return u > l ? u : l;
220
+ }, 0));
221
+ const r = Re.value ? Re.value.getBoundingClientRect().width : 0;
222
+ return a + r + (r ? 24 : 0);
223
+ }
224
+ const ge = b(0), be = b(0), Qt = He((a) => {
225
+ ge.value = a;
226
+ }, 100);
227
+ _t((a) => {
228
+ const r = e.value.orientation === "vertical" ? Y.value : W.value;
229
+ if (!r) return;
230
+ const t = new ResizeObserver((l) => {
231
+ Qt(l[0].contentRect.height);
232
+ });
233
+ t.observe(r), a(() => t.disconnect());
234
+ });
235
+ const jt = He((a) => {
236
+ be.value = a + e.value.style.chart.bars.totalValues.fontSize;
237
+ }, 100);
238
+ _t((a) => {
239
+ if (e.value.orientation === "vertical") return;
240
+ const r = Ze.value;
241
+ if (!r) return;
242
+ const t = new ResizeObserver((l) => {
243
+ jt(l[0].contentRect.width);
244
+ });
245
+ t.observe(r), a(() => t.disconnect());
246
+ }), St(() => {
247
+ ge.value = 0, be.value = 0;
248
+ });
249
+ const it = k(() => {
250
+ let a = 0;
251
+ Ie.value && (a = Ie.value.getBBox().height);
252
+ let r = 0;
253
+ return e.value.orientation === "vertical" && Y.value && (r = ge.value), e.value.orientation === "horizontal" && W.value && (r = ge.value), a + r;
254
+ }), n = k(() => {
255
+ const { height: a, width: r } = ye.value, { right: t } = ye.value.paddingRatio;
256
+ let l = e.value.style.chart.bars.totalValues.show && f.dataset && f.dataset.length > 1 ? e.value.style.chart.bars.totalValues.fontSize * 1.3 : 0, c = 0;
257
+ e.value.style.chart.grid.y.axisLabels.show && (c = Kt());
258
+ const u = e.value.style.chart.padding.top + l, S = r - r * t - be.value, X = a - e.value.style.chart.padding.bottom - it.value - l, G = e.value.style.chart.padding.left + c, J = r - G - r * t - be.value, R = a - u - e.value.style.chart.padding.bottom - it.value - l;
259
+ return {
260
+ chartHeight: a,
261
+ chartWidth: r,
262
+ top: u,
263
+ right: S,
264
+ bottom: X,
265
+ left: G,
266
+ width: Math.max(0, J),
267
+ height: Math.max(0, R)
268
+ };
269
+ }), D = k(() => ve.value.map((a, r) => {
270
+ const t = za(a.color) || Zt.value[r] || Ce[r] || Ce[r % Ce.length];
271
+ return {
272
+ ...a,
273
+ // In distributed mode, all values are converted to positive
274
+ series: JSON.parse(JSON.stringify(a.series)).map((l) => e.value.style.chart.bars.distributed ? Math.abs(l) : l),
275
+ // Store signs to manage display of neg values in distributed mode
276
+ signedSeries: a.series.map((l) => l >= 0 ? 1 : -1),
277
+ absoluteIndex: r,
278
+ id: Tt(),
279
+ color: t
280
+ };
281
+ })), F = k(() => Math.max(...D.value.filter((a) => !_.value.includes(a.id)).map((a) => a.series.length))), h = b({
282
+ start: 0,
283
+ end: Math.max(...ve.value.map((a) => a.series.length))
284
+ });
285
+ function nt() {
286
+ ut();
287
+ }
288
+ async function ut() {
289
+ (e.value.style.chart.zoom.startIndex !== null || e.value.style.chart.zoom.endIndex !== null) && ee.value ? (e.value.style.chart.zoom.startIndex !== null && (await Le(), await Le(), ee.value && ee.value.setStartValue(e.value.style.chart.zoom.startIndex)), e.value.style.chart.zoom.endIndex !== null && (await Le(), await Le(), ee.value && ee.value.setEndValue(ea(e.value.style.chart.zoom.endIndex + 1)))) : (h.value = {
290
+ start: 0,
291
+ end: Math.max(...ve.value.map((a) => a.series.length))
292
+ }, Je.value += 1);
293
+ }
294
+ function ea(a) {
295
+ const r = Math.max(...ve.value.map((t) => t.series.length));
296
+ 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;
297
+ }
298
+ const d = k(() => {
299
+ let a;
300
+ return e.value.orientation === "vertical" ? a = n.value.width / (h.value.end - h.value.start) : a = n.value.height / (h.value.end - h.value.start), a <= 0 ? 0 : a;
301
+ }), oe = k(() => Se(D.value.filter((a) => !_.value.includes(a.id))).slice(h.value.start, h.value.end)), ta = k(() => Se(D.value.filter((a) => !_.value.includes(a.id)).map((a) => ({
302
+ ...a,
303
+ series: a.series.map((r, t) => a.signedSeries[t] === -1 && r >= 0 ? -r : r)
304
+ }))).slice(h.value.start, h.value.end)), fe = k(() => {
305
+ const a = D.value.filter((r) => !_.value.includes(r.id));
306
+ return {
307
+ positive: Se(a.map((r) => ({
308
+ ...r,
309
+ series: r.series.slice(h.value.start, h.value.end).map((t) => t >= 0 ? t : 0)
310
+ }))),
311
+ negative: Se(a.map((r) => ({
312
+ ...r,
313
+ series: r.series.slice(h.value.start, h.value.end).map((t) => t < 0 ? t : 0)
314
+ })))
315
+ };
316
+ }), I = k(() => {
317
+ 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(...fe.value.positive), r = Math.min(...fe.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) ? Nt(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks) : It(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks);
318
+ return l.ticks.map((c) => ({
319
+ zero: n.value.bottom - n.value.height * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
320
+ y: n.value.bottom - n.value.height * ((c + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
321
+ x: n.value.left - 8,
322
+ horizontal_zero: n.value.left + n.value.width * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
323
+ horizontal_x: n.value.left + n.value.width * ((c + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
324
+ horizontal_y: n.value.bottom - 8,
325
+ value: c
326
+ }));
327
+ }), $ = k(() => Ua({
328
+ values: e.value.style.chart.grid.x.timeLabels.values,
329
+ maxDatapoints: F.value,
330
+ formatter: e.value.style.chart.grid.x.timeLabels.datetimeFormatter,
331
+ start: h.value.start,
332
+ end: h.value.end
333
+ })), w = k(() => {
334
+ if (!ne.value && !he.value) return [];
335
+ let a = Array(F.value).fill(0), r = Array(F.value).fill(0), t = Array(F.value).fill(0), l = Array(F.value).fill(0);
336
+ const c = Math.max(...fe.value.positive) || 0, u = Math.min(...fe.value.negative), S = [-1 / 0, 1 / 0, NaN, void 0, null].includes(u) ? 0 : u, X = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? Nt(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : S > 0 ? 0 : S, 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) : It(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : S > 0 ? 0 : S, 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: G, max: J } = X, R = J + (G >= 0 ? 0 : Math.abs(G)) || 1, T = n.value.height, we = n.value.width, wt = I.value[0] ? I.value[0].zero : n.value.bottom, Lt = I.value[0] ? I.value[0].horizontal_zero : n.value.left;
337
+ return D.value.filter((ie) => !_.value.includes(ie.id)).map((ie) => {
338
+ const O = ie.series.slice(h.value.start, h.value.end), ia = ie.signedSeries.slice(h.value.start, h.value.end), na = O.map((p, x) => n.value.left + d.value * x + d.value * e.value.style.chart.bars.gapRatio / 4), ua = O.map((p, x) => n.value.top + d.value * x + d.value * e.value.style.chart.bars.gapRatio / 4), ca = O.map((p, x) => {
339
+ const A = e.value.style.chart.bars.distributed ? (p || 0) / oe.value[x] : (p || 0) / R;
340
+ let q, N;
341
+ return p > 0 ? (N = T * A, q = wt - N - a[x], a[x] += N) : (N = T * A, q = wt + t[x], t[x] += Math.abs(N)), q;
342
+ }), ha = O.map((p, x) => {
343
+ const A = e.value.style.chart.bars.distributed ? (p || 0) / oe.value[x] : (p || 0) / R;
344
+ let q, N;
345
+ return p > 0 ? (N = we * A, q = Lt + r[x], r[x] += N) : (N = we * A, q = Lt - Math.abs(N) - l[x], l[x] += Math.abs(N)), q;
346
+ }), va = O.map((p, x) => {
347
+ const A = e.value.style.chart.bars.distributed ? (p || 0) / oe.value[x] : (p || 0) / R;
348
+ return p > 0 ? T * A : T * Math.abs(A);
349
+ }), da = O.map((p, x) => {
350
+ const A = e.value.style.chart.bars.distributed ? (p || 0) / oe.value[x] : (p || 0) / R;
351
+ return p > 0 ? we * A : we * Math.abs(A);
352
+ }), ya = O.map((p) => Math.abs(p)).reduce((p, x) => p + x, 0);
353
+ return {
354
+ ...ie,
355
+ proportions: O.map((p, x) => e.value.style.chart.bars.distributed ? (p || 0) / oe.value[x] : (p || 0) / ya),
356
+ series: O,
357
+ signedSeries: ia,
358
+ x: na,
359
+ y: ca,
360
+ height: va,
361
+ horizontal_width: da,
362
+ horizontal_y: ua,
363
+ horizontal_x: ha
364
+ };
365
+ });
366
+ }), ct = k(() => ta.value.map((a, r) => ({
367
+ value: a,
368
+ sign: a >= 0 ? 1 : -1
369
+ })));
370
+ function me(a, r, t, l, c) {
371
+ const u = c === -1 && a >= 0 ? -a : a;
372
+ return $e(
373
+ e.value.style.chart.bars.dataLabels.formatter,
374
+ u,
375
+ j({
376
+ p: e.value.style.chart.bars.dataLabels.prefix,
377
+ v: u,
378
+ s: e.value.style.chart.bars.dataLabels.suffix,
379
+ r: e.value.style.chart.bars.dataLabels.rounding
380
+ }),
381
+ { datapoint: r, seriesIndex: t, datapointIndex: l }
382
+ );
383
+ }
384
+ function ht(a, r, t, l) {
385
+ return $e(
386
+ e.value.style.chart.bars.dataLabels.formatter,
387
+ a,
388
+ j({
389
+ v: isNaN(a) ? 0 : a,
390
+ s: "%",
391
+ r: e.value.style.chart.bars.dataLabels.rounding
392
+ }),
393
+ { datapoint: r, seriesIndex: t, datapointIndex: l }
394
+ );
395
+ }
396
+ function vt(a) {
397
+ const r = JSON.parse(JSON.stringify(w.value)).map((t) => ({
398
+ name: t.name,
399
+ value: t.series[a] === 0 ? 0 : t.series[a] || null,
400
+ proportion: t.proportions[a] || null,
401
+ color: t.color,
402
+ id: t.id
403
+ }));
404
+ Me("selectDatapoint", { datapoint: r, period: $.value[a] });
405
+ }
406
+ function dt(a) {
407
+ se.value = a, ue.value = !0;
408
+ const r = e.value.style.chart.tooltip.customFormat, t = JSON.parse(JSON.stringify(w.value)).map((c) => ({
409
+ name: c.name,
410
+ absoluteIndex: c.absoluteIndex,
411
+ value: c.series[a] === 0 ? 0 : (c.signedSeries[a] === -1 && c.series[a] >= 0 ? -c.series[a] : c.series[a]) || null,
412
+ proportion: c.proportions[a] || null,
413
+ color: c.color,
414
+ id: c.id
415
+ }));
416
+ Ae.value = {
417
+ datapoint: t,
418
+ seriesIndex: a,
419
+ config: e.value,
420
+ series: w.value
421
+ };
422
+ const l = t.map((c) => Math.abs(c.value)).reduce((c, u) => c + u, 0);
423
+ if (Ot(r) && Aa(() => r({
424
+ seriesIndex: a,
425
+ datapoint: t,
426
+ series: w.value,
427
+ config: e.value
428
+ })))
429
+ Ne.value = r({
430
+ seriesIndex: a,
431
+ datapoint: t,
432
+ series: w.value,
433
+ config: e.value
434
+ });
435
+ else {
436
+ const {
437
+ showValue: c,
438
+ showPercentage: u,
439
+ borderColor: S,
440
+ roundingValue: X,
441
+ roundingPercentage: G
442
+ } = e.value.style.chart.tooltip;
443
+ let J = "";
444
+ $.value[a] && $.value[a].text && e.value.style.chart.tooltip.showTimeLabel && (J += `<div style="width:100%;text-align:center;border-bottom:1px solid ${S};padding-bottom:6px;margin-bottom:3px;">${$.value[a].text}</div>`);
445
+ const R = [
446
+ c && u ? "(" : "",
447
+ c && u ? ")" : ""
448
+ ];
449
+ t.reverse().forEach((T) => {
450
+ J += `
451
+ <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
452
+ <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_${T.id})` : T.color}"/>${Xt.pattern ? `<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${V.value}_${T.absoluteIndex})"/>` : ""}</svg>
453
+ ${T.name}${c || u ? ":" : ""} ${c ? j({
454
+ p: e.value.style.chart.bars.dataLabels.prefix,
455
+ v: T.value,
456
+ s: e.value.style.chart.bars.dataLabels.suffix,
457
+ r: X
458
+ }) : ""} ${R[0]}${u ? j({
459
+ v: isNaN(T.value / l) ? 0 : Math.abs(T.value) / l * 100,
460
+ // Negs are absed to show relative proportion to absolute total. It's opinionated.
461
+ s: "%",
462
+ r: G
463
+ }) : ""}${R[1]}
464
+ </div>
465
+ `;
466
+ }), Ne.value = `<div>${J}</div>`;
467
+ }
468
+ }
469
+ Pa({
470
+ timeLabelsEls: e.value.orientation === "vertical" ? Y : W,
471
+ timeLabels: $,
472
+ slicer: h,
473
+ configRef: e,
474
+ rotationPath: ["style", "chart", "grid", "x", "timeLabels", "rotation"],
475
+ autoRotatePath: ["style", "chart", "grid", "x", "timeLabels", "autoRotate"],
476
+ isAutoSize: !1
477
+ });
478
+ function yt(a) {
479
+ ce.value = a, Be.value += 1;
480
+ }
481
+ function gt() {
482
+ z.value.showTable = !z.value.showTable;
483
+ }
484
+ function bt() {
485
+ z.value.dataLabels.show = !z.value.dataLabels.show;
486
+ }
487
+ function ft() {
488
+ z.value.showTooltip = !z.value.showTooltip;
489
+ }
490
+ function aa() {
491
+ return w.value;
492
+ }
493
+ const mt = k(() => {
494
+ if (w.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
495
+ const a = w.value.map(({ name: t, color: l }) => ({
496
+ label: t,
497
+ color: l
498
+ })), r = [];
499
+ return $.value.forEach((t) => {
500
+ const l = [e.value.style.chart.grid.x.timeLabels.values[t.absoluteIndex] ? t.text : i + 1];
501
+ D.value.forEach((c) => {
502
+ l.push(Number((c.series[t.absoluteIndex] || 0).toFixed(e.value.table.td.roundingValue)));
503
+ }), r.push(l);
504
+ }), { head: a, body: r };
505
+ });
506
+ function pt(a = null) {
507
+ const r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], t = ["", ...mt.value.head.map((S) => S.label)], l = mt.value.body, c = r.concat([t]).concat(l), u = Ta(c);
508
+ a ? a(u) : Ma({ csvContent: u, title: e.value.style.chart.title.text || "vue-ui-stackbar" });
509
+ }
510
+ const pe = k(() => {
511
+ const a = [""].concat(w.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>');
512
+ let r = [];
513
+ for (let c = 0; c < F.value; c += 1) {
514
+ const u = w.value.map((S) => S.series[c] ?? 0).reduce((S, X) => S + X, 0);
515
+ r.push([e.value.style.chart.grid.x.timeLabels.values.slice(h.value.start, h.value.end)[c] ? $.value[c].text : c + 1].concat(w.value.map((S) => (S.series[c] ?? 0).toFixed(e.value.table.td.roundingValue))).concat((u ?? 0).toFixed(e.value.table.td.roundingValue)));
516
+ }
517
+ const t = {
518
+ th: {
519
+ backgroundColor: e.value.table.th.backgroundColor,
520
+ color: e.value.table.th.color,
521
+ outline: e.value.table.th.outline
522
+ },
523
+ td: {
524
+ backgroundColor: e.value.table.td.backgroundColor,
525
+ color: e.value.table.td.color,
526
+ outline: e.value.table.td.outline
527
+ },
528
+ breakpoint: e.value.table.responsiveBreakpoint
529
+ }, l = [e.value.table.columnNames.period].concat(w.value.map((c) => c.name)).concat(e.value.table.columnNames.total);
530
+ return { head: a, body: r.slice(0, h.value.end - h.value.start), config: t, colNames: l };
531
+ });
532
+ function la(a, r) {
533
+ if (Me("selectLegend", w.value.find((t) => t.absoluteIndex === a)), _.value.includes(r.id))
534
+ _.value = _.value.filter((t) => t !== r.id);
535
+ else {
536
+ if (_.value.length === D.value.length - 1) return;
537
+ _.value.push(r.id);
538
+ }
539
+ }
540
+ const xt = k(() => D.value.map((a, r) => ({
541
+ ...a,
542
+ shape: "square"
543
+ })).map((a) => ({
544
+ ...a,
545
+ opacity: _.value.includes(a.id) ? 0.5 : 1,
546
+ segregate: () => la(a.absoluteIndex, a),
547
+ isSegregated: _.value.includes(a.id)
548
+ }))), ra = k(() => ({
549
+ cy: "stackbar-legend",
550
+ backgroundColor: e.value.style.chart.legend.backgroundColor,
551
+ color: e.value.style.chart.legend.color,
552
+ fontSize: e.value.style.chart.legend.fontSize,
553
+ paddingBottom: 12,
554
+ fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
555
+ })), xe = b(!1);
556
+ function De() {
557
+ xe.value = !xe.value;
558
+ }
559
+ function ke(a, r) {
560
+ const t = JSON.parse(JSON.stringify(w.value)).map((l) => ({
561
+ name: l.name,
562
+ value: l.series[r] === 0 ? 0 : (l.signedSeries[r] === -1 && l.series[r] >= 0 ? -l.series[r] : l.series[r]) || null,
563
+ proportion: l.proportions[r] || null,
564
+ color: l.color,
565
+ id: l.id
566
+ }));
567
+ Me("selectTimeLabel", {
568
+ datapoint: t,
569
+ absoluteIndex: a.absoluteIndex,
570
+ label: a.text
571
+ });
572
+ }
573
+ const sa = k(() => Math.max(...w.value.flatMap((a) => a.series)));
574
+ function kt(a, r) {
575
+ return e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? tt.value ? r * 100 >= e.value.style.chart.bars.dataLabels.hideUnderPercentage : e.value.style.chart.bars.dataLabels.hideEmptyPercentages ? r > 0 : !0 : tt.value ? (et.value && Ve.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 > sa.value * e.value.style.chart.bars.dataLabels.hideUnderPercentage / 100) : et.value ? Math.abs(a) >= e.value.style.chart.bars.dataLabels.hideUnderValue : e.value.style.chart.bars.dataLabels.hideEmptyValues ? a !== 0 : !0;
576
+ }
577
+ async function oa({ scale: a = 2 } = {}) {
578
+ if (!P.value) return;
579
+ const { width: r, height: t } = P.value.getBoundingClientRect(), l = r / t, { imageUri: c, base64: u } = await Ha({ domElement: P.value, base64: !0, img: !0, scale: a });
580
+ return {
581
+ imageUri: c,
582
+ base64: u,
583
+ title: e.value.style.chart.title.text,
584
+ width: r,
585
+ height: t,
586
+ aspectRatio: l
587
+ };
588
+ }
589
+ return Vt({
590
+ getData: aa,
591
+ getImage: oa,
592
+ generatePdf: rt,
593
+ generateCsv: pt,
594
+ generateImage: st,
595
+ toggleTable: gt,
596
+ toggleLabels: bt,
597
+ toggleTooltip: ft,
598
+ toggleAnnotator: De,
599
+ toggleFullscreen: yt
600
+ }), (a, r) => (s(), o("div", {
601
+ id: `stackbar_${V.value}`,
602
+ ref_key: "stackbarChart",
603
+ ref: P,
604
+ class: le({ "vue-ui-stackbar": !0, "vue-data-ui-wrapper-fullscreen": ce.value }),
605
+ style: Z(`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%" : ""}`),
606
+ onMouseenter: r[6] || (r[6] = () => v(Ke)(!0)),
607
+ onMouseleave: r[7] || (r[7] = () => v(Ke)(!1))
608
+ }, [
609
+ e.value.userOptions.buttons.annotator ? (s(), K(v(Ht), {
610
+ key: 0,
611
+ svgRef: v(je),
612
+ backgroundColor: e.value.style.chart.backgroundColor,
613
+ color: e.value.style.chart.color,
614
+ active: xe.value,
615
+ onClose: De
616
+ }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : y("", !0),
617
+ L(a.$slots, "userConfig", {}, void 0, !0),
618
+ e.value.style.chart.title.text ? (s(), o("div", {
619
+ key: 1,
620
+ ref_key: "chartTitle",
621
+ ref: We,
622
+ style: "width:100%;background:transparent;padding-bottom:24px"
623
+ }, [
624
+ (s(), K(Da, {
625
+ key: `title_${qe.value}`,
626
+ config: {
627
+ title: {
628
+ cy: "stackbar-title",
629
+ ...e.value.style.chart.title
630
+ },
631
+ subtitle: {
632
+ cy: "stackbar-subtitle",
633
+ ...e.value.style.chart.title.subtitle
634
+ }
635
+ }
636
+ }, null, 8, ["config"]))
637
+ ], 512)) : y("", !0),
638
+ e.value.userOptions.show && ne.value && (v(Qe) || v(Oe)) ? (s(), K(v(Wt), {
639
+ ref: "details",
640
+ key: `user_option_${Be.value}`,
641
+ backgroundColor: e.value.style.chart.backgroundColor,
642
+ color: e.value.style.chart.color,
643
+ isPrinting: v(at),
644
+ isImaging: v(lt),
645
+ uid: V.value,
646
+ hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
647
+ hasPdf: e.value.userOptions.buttons.pdf,
648
+ hasImg: e.value.userOptions.buttons.img,
649
+ hasXls: e.value.userOptions.buttons.csv,
650
+ hasTable: e.value.userOptions.buttons.table,
651
+ hasLabel: e.value.userOptions.buttons.labels,
652
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
653
+ isFullscreen: ce.value,
654
+ chartElement: P.value,
655
+ position: e.value.userOptions.position,
656
+ isTooltip: z.value.showTooltip,
657
+ titles: { ...e.value.userOptions.buttonTitles },
658
+ hasAnnotator: e.value.userOptions.buttons.annotator,
659
+ isAnnotation: xe.value,
660
+ callbacks: e.value.userOptions.callbacks,
661
+ printScale: e.value.userOptions.print.scale,
662
+ onToggleFullscreen: yt,
663
+ onGeneratePdf: v(rt),
664
+ onGenerateCsv: pt,
665
+ onGenerateImage: v(st),
666
+ onToggleTable: gt,
667
+ onToggleLabels: bt,
668
+ onToggleTooltip: ft,
669
+ onToggleAnnotator: De,
670
+ style: Z({
671
+ visibility: v(Qe) ? v(Oe) ? "visible" : "hidden" : "visible"
672
+ })
673
+ }, $t({ _: 2 }, [
674
+ a.$slots.menuIcon ? {
675
+ name: "menuIcon",
676
+ fn: C(({ isOpen: t, color: l }) => [
677
+ L(a.$slots, "menuIcon", U(H({ isOpen: t, color: l })), void 0, !0)
678
+ ]),
679
+ key: "0"
680
+ } : void 0,
681
+ a.$slots.optionTooltip ? {
682
+ name: "optionTooltip",
683
+ fn: C(() => [
684
+ L(a.$slots, "optionTooltip", {}, void 0, !0)
685
+ ]),
686
+ key: "1"
687
+ } : void 0,
688
+ a.$slots.optionPdf ? {
689
+ name: "optionPdf",
690
+ fn: C(() => [
691
+ L(a.$slots, "optionPdf", {}, void 0, !0)
692
+ ]),
693
+ key: "2"
694
+ } : void 0,
695
+ a.$slots.optionCsv ? {
696
+ name: "optionCsv",
697
+ fn: C(() => [
698
+ L(a.$slots, "optionCsv", {}, void 0, !0)
699
+ ]),
700
+ key: "3"
701
+ } : void 0,
702
+ a.$slots.optionImg ? {
703
+ name: "optionImg",
704
+ fn: C(() => [
705
+ L(a.$slots, "optionImg", {}, void 0, !0)
706
+ ]),
707
+ key: "4"
708
+ } : void 0,
709
+ a.$slots.optionTable ? {
710
+ name: "optionTable",
711
+ fn: C(() => [
712
+ L(a.$slots, "optionTable", {}, void 0, !0)
713
+ ]),
714
+ key: "5"
715
+ } : void 0,
716
+ a.$slots.optionLabels ? {
717
+ name: "optionLabels",
718
+ fn: C(() => [
719
+ L(a.$slots, "optionLabels", {}, void 0, !0)
720
+ ]),
721
+ key: "6"
722
+ } : void 0,
723
+ a.$slots.optionFullscreen ? {
724
+ name: "optionFullscreen",
725
+ fn: C(({ toggleFullscreen: t, isFullscreen: l }) => [
726
+ L(a.$slots, "optionFullscreen", U(H({ toggleFullscreen: t, isFullscreen: l })), void 0, !0)
727
+ ]),
728
+ key: "7"
729
+ } : void 0,
730
+ a.$slots.optionAnnotator ? {
731
+ name: "optionAnnotator",
732
+ fn: C(({ toggleAnnotator: t, isAnnotator: l }) => [
733
+ L(a.$slots, "optionAnnotator", U(H({ toggleAnnotator: t, isAnnotator: l })), void 0, !0)
734
+ ]),
735
+ key: "8"
736
+ } : void 0
737
+ ]), 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"])) : y("", !0),
738
+ (s(), o("svg", {
739
+ ref_key: "svgRef",
740
+ ref: je,
741
+ xmlns: v(Ca),
742
+ viewBox: `0 0 ${n.value.chartWidth <= 0 ? 10 : n.value.chartWidth} ${n.value.chartHeight <= 0 ? 10 : n.value.chartHeight}`,
743
+ class: le({ "vue-data-ui-loading": v(he) }),
744
+ style: Z(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
745
+ }, [
746
+ ze(v(Ut)),
747
+ a.$slots["chart-background"] ? (s(), o("foreignObject", {
748
+ key: 0,
749
+ x: n.value.left,
750
+ y: n.value.top,
751
+ width: n.value.width <= 0 ? 10 : n.value.width,
752
+ height: n.value.height <= 0 ? 10 : n.value.height,
753
+ style: {
754
+ pointerEvents: "none"
755
+ }
756
+ }, [
757
+ L(a.$slots, "chart-background", {}, void 0, !0)
758
+ ], 8, Ja)) : y("", !0),
759
+ e.value.style.chart.bars.gradient.show ? (s(), o("defs", qa, [
760
+ (s(!0), o(g, null, m(w.value, (t, l) => (s(), o("linearGradient", {
761
+ id: `gradient_${t.id}`,
762
+ x1: "0%",
763
+ y1: "0%",
764
+ x2: "0%",
765
+ y2: "100%"
766
+ }, [
767
+ Q("stop", {
768
+ offset: "0%",
769
+ "stop-color": t.color
770
+ }, null, 8, Ka),
771
+ Q("stop", {
772
+ offset: "61.8%",
773
+ "stop-color": v(Sa)(t.color, e.value.style.chart.bars.gradient.intensity / 100)
774
+ }, null, 8, Qa),
775
+ Q("stop", {
776
+ offset: "100%",
777
+ "stop-color": t.color
778
+ }, null, 8, ja)
779
+ ], 8, Za))), 256))
780
+ ])) : y("", !0),
781
+ e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "vertical" ? (s(!0), o(g, { key: 2 }, m(I.value, (t, l) => (s(), o("line", {
782
+ x1: n.value.left,
783
+ x2: n.value.right,
784
+ y1: t.y,
785
+ y2: t.y,
786
+ stroke: e.value.style.chart.grid.x.linesColor,
787
+ "stroke-width": e.value.style.chart.grid.x.linesThickness,
788
+ "stroke-dasharray": e.value.style.chart.grid.x.linesStrokeDasharray,
789
+ "stroke-linecap": "round"
790
+ }, null, 8, el))), 256)) : y("", !0),
791
+ e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (s(!0), o(g, { key: 3 }, m(h.value.end - h.value.start + 1, (t, l) => (s(), o("line", {
792
+ x1: n.value.left,
793
+ x2: n.value.right,
794
+ y1: n.value.top + d.value * l,
795
+ y2: n.value.top + d.value * l,
796
+ stroke: e.value.style.chart.grid.x.linesColor,
797
+ "stroke-width": e.value.style.chart.grid.x.linesThickness,
798
+ "stroke-dasharray": e.value.style.chart.grid.x.linesStrokeDasharray,
799
+ "stroke-linecap": "round"
800
+ }, null, 8, tl))), 256)) : y("", !0),
801
+ e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "vertical" ? (s(!0), o(g, { key: 4 }, m(h.value.end - h.value.start + 1, (t, l) => (s(), o("line", {
802
+ x1: n.value.left + d.value * l,
803
+ x2: n.value.left + d.value * l,
804
+ y1: n.value.top,
805
+ y2: n.value.bottom,
806
+ stroke: e.value.style.chart.grid.y.linesColor,
807
+ "stroke-width": e.value.style.chart.grid.y.linesThickness,
808
+ "stroke-dasharray": e.value.style.chart.grid.y.linesStrokeDasharray,
809
+ "stroke-linecap": "round"
810
+ }, null, 8, al))), 256)) : y("", !0),
811
+ e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "horizontal" ? (s(!0), o(g, { key: 5 }, m(I.value, (t, l) => (s(), o("line", {
812
+ x1: t.horizontal_x,
813
+ x2: t.horizontal_x,
814
+ y1: n.value.top,
815
+ y2: n.value.bottom,
816
+ stroke: e.value.style.chart.grid.y.linesColor,
817
+ "stroke-width": e.value.style.chart.grid.y.linesThickness,
818
+ "stroke-dasharray": e.value.style.chart.grid.y.linesStrokeDasharray,
819
+ "stroke-linecap": "round"
820
+ }, null, 8, ll))), 256)) : y("", !0),
821
+ (s(!0), o(g, null, m(w.value, (t, l) => (s(), o("g", null, [
822
+ a.$slots.pattern ? (s(), o("defs", rl, [
823
+ L(a.$slots, "pattern", Ue({ ref_for: !0 }, { seriesIndex: t.absoluteIndex, patternId: `pattern_${V.value}_${t.absoluteIndex}` }), void 0, !0)
824
+ ])) : y("", !0),
825
+ e.value.orientation === "vertical" ? (s(), o(g, { key: 1 }, [
826
+ (s(!0), o(g, null, m(t.x, (c, u) => (s(), o("rect", {
827
+ x: c,
828
+ y: t.y[u] < 0 ? 0 : t.y[u],
829
+ height: t.height[u] < 0 ? 1e-4 : t.height[u] || 0,
830
+ 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,
831
+ width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
832
+ fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
833
+ stroke: e.value.style.chart.backgroundColor,
834
+ "stroke-width": e.value.style.chart.bars.strokeWidth,
835
+ "stroke-linecap": "round",
836
+ "stroke-linejoin": "round",
837
+ class: le({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": B.value })
838
+ }, null, 10, sl))), 256)),
839
+ a.$slots.pattern ? (s(), o("g", ol, [
840
+ (s(!0), o(g, null, m(t.x, (c, u) => (s(), o("rect", {
841
+ x: c,
842
+ y: t.y[u] < 0 ? 0 : t.y[u],
843
+ height: t.height[u] < 0 ? 1e-4 : t.height[u] || 0,
844
+ 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,
845
+ width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
846
+ fill: `url(#pattern_${V.value}_${t.absoluteIndex})`,
847
+ stroke: e.value.style.chart.backgroundColor,
848
+ "stroke-width": e.value.style.chart.bars.strokeWidth,
849
+ "stroke-linecap": "round",
850
+ "stroke-linejoin": "round",
851
+ class: le({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": B.value })
852
+ }, null, 10, il))), 256))
853
+ ])) : y("", !0)
854
+ ], 64)) : (s(), o(g, { key: 2 }, [
855
+ (s(!0), o(g, null, m(t.horizontal_x, (c, u) => (s(), o("rect", {
856
+ x: v(_e)(c, n.value.left),
857
+ y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
858
+ width: v(_e)(t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]),
859
+ 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,
860
+ height: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
861
+ fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
862
+ stroke: e.value.style.chart.backgroundColor,
863
+ "stroke-width": e.value.style.chart.bars.strokeWidth,
864
+ "stroke-linecap": "round",
865
+ "stroke-linejoin": "round",
866
+ class: le({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": B.value })
867
+ }, null, 10, nl))), 256)),
868
+ a.$slots.pattern ? (s(), o("g", ul, [
869
+ (s(!0), o(g, null, m(t.horizontal_x, (c, u) => (s(), o("rect", {
870
+ x: v(_e)(c, n.value.left),
871
+ y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
872
+ width: v(_e)(t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]),
873
+ 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,
874
+ height: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
875
+ fill: `url(#pattern_${V.value}_${t.absoluteIndex})`,
876
+ stroke: e.value.style.chart.backgroundColor,
877
+ "stroke-width": e.value.style.chart.bars.strokeWidth,
878
+ "stroke-linecap": "round",
879
+ "stroke-linejoin": "round",
880
+ class: le({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": B.value })
881
+ }, null, 10, cl))), 256))
882
+ ])) : y("", !0)
883
+ ], 64))
884
+ ]))), 256)),
885
+ e.value.style.chart.grid.x.showAxis ? (s(), o("line", {
886
+ key: 6,
887
+ x1: n.value.left,
888
+ x2: n.value.right,
889
+ y1: n.value.bottom,
890
+ y2: n.value.bottom,
891
+ stroke: e.value.style.chart.grid.x.axisColor,
892
+ "stroke-width": e.value.style.chart.grid.x.axisThickness,
893
+ "stroke-linecap": "round",
894
+ "stroke-linejoin": "round"
895
+ }, null, 8, hl)) : y("", !0),
896
+ e.value.style.chart.grid.y.showAxis && !e.value.style.chart.bars.distributed ? (s(), o("line", {
897
+ key: 7,
898
+ x1: n.value.left,
899
+ x2: n.value.left,
900
+ y1: n.value.top,
901
+ y2: n.value.bottom,
902
+ stroke: e.value.style.chart.grid.y.axisColor,
903
+ "stroke-width": e.value.style.chart.grid.y.axisThickness,
904
+ "stroke-linecap": "round",
905
+ "stroke-linejoin": "round"
906
+ }, null, 8, vl)) : y("", !0),
907
+ e.value.style.chart.grid.x.axisName.show && e.value.style.chart.grid.x.axisName.text ? (s(), o("text", {
908
+ key: 8,
909
+ ref_key: "xAxisLabel",
910
+ ref: Ie,
911
+ x: n.value.left + n.value.width / 2,
912
+ y: n.value.chartHeight - 3,
913
+ "font-size": e.value.style.chart.grid.x.axisName.fontSize,
914
+ fill: e.value.style.chart.grid.x.axisName.color,
915
+ "font-weight": e.value.style.chart.grid.x.axisName.bold ? "bold" : "normal",
916
+ "text-anchor": "middle"
917
+ }, M(e.value.style.chart.grid.x.axisName.text), 9, dl)) : y("", !0),
918
+ e.value.style.chart.grid.y.axisName.show && e.value.style.chart.grid.y.axisName.text ? (s(), o("text", {
919
+ key: 9,
920
+ ref_key: "yAxisLabel",
921
+ ref: Re,
922
+ transform: `translate(${e.value.style.chart.grid.y.axisName.fontSize}, ${n.value.top + n.value.height / 2}) rotate(-90)`,
923
+ "font-size": e.value.style.chart.grid.y.axisName.fontSize,
924
+ fill: e.value.style.chart.grid.y.axisName.color,
925
+ "font-weight": e.value.style.chart.grid.y.axisName.bold ? "bold" : "normal",
926
+ "text-anchor": "middle"
927
+ }, M(e.value.style.chart.grid.y.axisName.text), 9, yl)) : y("", !0),
928
+ z.value.dataLabels.show && e.value.orientation === "vertical" ? (s(), o(g, { key: 10 }, [
929
+ (s(!0), o(g, null, m(w.value, (t, l) => (s(), o("g", null, [
930
+ (s(!0), o(g, null, m(t.x, (c, u) => (s(), o(g, null, [
931
+ kt(t.series[u], t.proportions[u]) ? (s(), o("text", {
932
+ key: 0,
933
+ x: c + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2,
934
+ y: t.y[u] + t.height[u] / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
935
+ "font-size": e.value.style.chart.bars.dataLabels.fontSize,
936
+ fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? v(Rt)(t.color) : e.value.style.chart.bars.dataLabels.color,
937
+ "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
938
+ "text-anchor": "middle"
939
+ }, M(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? ht(t.proportions[u] * 100, t, l, u) : me(t.series[u], t, l, u, t.signedSeries[u])), 9, gl)) : y("", !0)
940
+ ], 64))), 256))
941
+ ]))), 256)),
942
+ e.value.style.chart.bars.totalValues.show && w.value.length > 1 ? (s(), o("g", {
943
+ key: 0,
944
+ ref_key: "sumTop",
945
+ ref: qt
946
+ }, [
947
+ (s(!0), o(g, null, m(ct.value, (t, l) => (s(), o(g, null, [
948
+ !e.value.style.chart.bars.dataLabels.hideEmptyValues || t.value !== 0 ? (s(), o("text", {
949
+ key: 0,
950
+ x: n.value.left + d.value * l + d.value / 2,
951
+ y: e.value.style.chart.bars.totalValues.fontSize,
952
+ "text-anchor": "middle",
953
+ "font-size": e.value.style.chart.bars.totalValues.fontSize,
954
+ "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
955
+ fill: e.value.style.chart.bars.totalValues.color
956
+ }, M(me(t.value, t, l, t.sign)), 9, bl)) : y("", !0)
957
+ ], 64))), 256))
958
+ ], 512)) : y("", !0)
959
+ ], 64)) : y("", !0),
960
+ z.value.dataLabels.show && e.value.orientation === "horizontal" ? (s(), o(g, { key: 11 }, [
961
+ (s(!0), o(g, null, m(w.value, (t, l) => (s(), o("g", null, [
962
+ (s(!0), o(g, null, m(t.horizontal_x, (c, u) => (s(), o(g, null, [
963
+ kt(t.series[u], t.proportions[u]) ? (s(), o("text", {
964
+ key: 0,
965
+ x: c + (t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]) / 2,
966
+ y: t.horizontal_y[u] + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
967
+ "font-size": e.value.style.chart.bars.dataLabels.fontSize,
968
+ fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? v(Rt)(t.color) : e.value.style.chart.bars.dataLabels.color,
969
+ "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
970
+ "text-anchor": "middle"
971
+ }, M(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? ht(t.proportions[u] * 100, t, l, u) : me(t.series[u], t, l, u, t.signedSeries[u])), 9, fl)) : y("", !0)
972
+ ], 64))), 256))
973
+ ]))), 256)),
974
+ e.value.style.chart.bars.totalValues.show && w.value.length > 1 ? (s(), o("g", {
975
+ key: 0,
976
+ ref_key: "sumRight",
977
+ ref: Ze
978
+ }, [
979
+ (s(!0), o(g, null, m(ct.value, (t, l) => (s(), o(g, null, [
980
+ !e.value.style.chart.bars.dataLabels.hideEmptyValues || t.value !== 0 ? (s(), o("text", {
981
+ key: 0,
982
+ x: n.value.right + e.value.style.chart.bars.totalValues.fontSize / 3,
983
+ y: n.value.top + d.value * l + d.value / 2,
984
+ "text-anchor": "start",
985
+ "font-size": e.value.style.chart.bars.totalValues.fontSize,
986
+ "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
987
+ fill: e.value.style.chart.bars.totalValues.color
988
+ }, M(me(t.value, t, l, t.sign)), 9, ml)) : y("", !0)
989
+ ], 64))), 256))
990
+ ], 512)) : y("", !0)
991
+ ], 64)) : y("", !0),
992
+ e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "vertical" ? (s(), o("g", {
993
+ key: 12,
994
+ ref_key: "scaleLabels",
995
+ ref: W
996
+ }, [
997
+ (s(!0), o(g, null, m(I.value, (t, l) => (s(), o("line", {
998
+ x1: n.value.left,
999
+ x2: n.value.left - 6,
1000
+ y1: t.y,
1001
+ y2: t.y,
1002
+ stroke: e.value.style.chart.grid.x.axisColor,
1003
+ "stroke-width": 1
1004
+ }, null, 8, pl))), 256)),
1005
+ (s(!0), o(g, null, m(I.value, (t, l) => (s(), o("text", {
1006
+ x: t.x,
1007
+ y: t.y + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
1008
+ "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
1009
+ "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
1010
+ fill: e.value.style.chart.grid.y.axisLabels.color,
1011
+ "text-anchor": "end"
1012
+ }, M(v($e)(
1013
+ e.value.style.chart.grid.y.axisLabels.formatter,
1014
+ t.value,
1015
+ v(j)({
1016
+ p: e.value.style.chart.bars.dataLabels.prefix,
1017
+ v: t.value,
1018
+ s: e.value.style.chart.bars.dataLabels.suffix,
1019
+ r: e.value.style.chart.grid.y.axisLabels.rounding
1020
+ }),
1021
+ { datapoint: t }
1022
+ )), 9, xl))), 256))
1023
+ ], 512)) : y("", !0),
1024
+ e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "horizontal" ? (s(), o("g", {
1025
+ key: 13,
1026
+ ref_key: "scaleLabels",
1027
+ ref: W
1028
+ }, [
1029
+ (s(!0), o(g, null, m(I.value, (t, l) => (s(), o("line", {
1030
+ x1: t.horizontal_x,
1031
+ x2: t.horizontal_x,
1032
+ y1: n.value.bottom,
1033
+ y2: n.value.bottom + 6,
1034
+ stroke: e.value.style.chart.grid.x.axisColor,
1035
+ "stroke-width": 1,
1036
+ "stroke-linecap": "round"
1037
+ }, null, 8, kl))), 256)),
1038
+ (s(!0), o(g, null, m(I.value, (t, l) => (s(), o("text", {
1039
+ class: "vue-data-ui-time-label",
1040
+ "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
1041
+ "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
1042
+ fill: e.value.style.chart.grid.y.axisLabels.color,
1043
+ "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
1044
+ transform: `translate(${t.horizontal_x}, ${n.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})`
1045
+ }, M(v($e)(
1046
+ e.value.style.chart.grid.y.axisLabels.formatter,
1047
+ t.value,
1048
+ v(j)({
1049
+ p: e.value.style.chart.bars.dataLabels.prefix,
1050
+ v: t.value,
1051
+ s: e.value.style.chart.bars.dataLabels.suffix,
1052
+ r: e.value.style.chart.grid.y.axisLabels.rounding
1053
+ }),
1054
+ { datapoint: t }
1055
+ )), 9, wl))), 256))
1056
+ ], 512)) : y("", !0),
1057
+ e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "vertical" ? (s(), o("g", {
1058
+ key: 14,
1059
+ ref_key: "timeLabelsEls",
1060
+ ref: Y
1061
+ }, [
1062
+ a.$slots["time-label"] ? (s(), o("g", Ll, [
1063
+ (s(!0), o(g, null, m($.value, (t, l) => (s(), o("g", null, [
1064
+ L(a.$slots, "time-label", Ue({ ref_for: !0 }, {
1065
+ x: n.value.left + d.value * l + d.value / 2,
1066
+ y: n.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY,
1067
+ fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
1068
+ fill: e.value.style.chart.grid.x.timeLabels.color,
1069
+ transform: `translate(${n.value.left + d.value * l + d.value / 2}, ${n.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})`,
1070
+ absoluteIndex: t.absoluteIndex,
1071
+ content: t.text,
1072
+ textAnchor: e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
1073
+ show: !0
1074
+ }), void 0, !0)
1075
+ ]))), 256))
1076
+ ])) : (s(), o("g", zl, [
1077
+ (s(!0), o(g, null, m($.value, (t, l) => (s(), o("g", null, [
1078
+ String(t.text).includes(`
1079
+ `) ? (s(), o("text", {
1080
+ key: l + "-multi",
1081
+ "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
1082
+ "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
1083
+ fill: e.value.style.chart.grid.x.timeLabels.color,
1084
+ transform: `
1085
+ translate(
1086
+ ${n.value.left + d.value * l + d.value / 2},
1087
+ ${n.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}
1088
+ ),
1089
+ rotate(${e.value.style.chart.grid.x.timeLabels.rotation})
1090
+ `,
1091
+ style: { cursor: "pointer" },
1092
+ innerHTML: v(_a)({
1093
+ content: String(t.text),
1094
+ fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
1095
+ fill: e.value.style.chart.grid.x.timeLabels.color,
1096
+ x: 0,
1097
+ y: 0
1098
+ }),
1099
+ onClick: () => ke(t, l)
1100
+ }, null, 8, Sl)) : (s(), o("text", {
1101
+ class: "vue-data-ui-time-label",
1102
+ key: l,
1103
+ "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
1104
+ "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
1105
+ "font-weight": e.value.style.chart.grid.x.timeLabels.bold ? "bold" : "normal",
1106
+ fill: e.value.style.chart.grid.x.timeLabels.color,
1107
+ transform: `translate(${n.value.left + d.value * l + d.value / 2}, ${n.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})`,
1108
+ style: { cursor: "pointer" },
1109
+ onClick: () => ke(t, l)
1110
+ }, M(t.text), 9, Cl))
1111
+ ]))), 256))
1112
+ ]))
1113
+ ], 512)) : y("", !0),
1114
+ e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "horizontal" ? (s(), o("g", {
1115
+ key: 15,
1116
+ ref_key: "timeLabelsEls",
1117
+ ref: Y
1118
+ }, [
1119
+ a.$slots["time-label"] ? (s(), o("g", _l, [
1120
+ (s(!0), o(g, null, m($.value, (t, l) => (s(), o("g", null, [
1121
+ L(a.$slots, "time-label", Ue({ ref_for: !0 }, {
1122
+ x: n.value.left - 8,
1123
+ y: n.value.top + d.value * l + d.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
1124
+ fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
1125
+ fill: e.value.style.chart.grid.x.timeLabels.color,
1126
+ transform: null,
1127
+ absoluteIndex: t.absoluteIndex,
1128
+ content: t.text,
1129
+ textAnchor: "end",
1130
+ show: !0
1131
+ }), void 0, !0)
1132
+ ]))), 256))
1133
+ ])) : (s(), o("g", $l, [
1134
+ (s(!0), o(g, null, m($.value, (t, l) => (s(), o("g", null, [
1135
+ String(t.text).includes(`
1136
+ `) ? (s(), o("text", {
1137
+ key: 1,
1138
+ "text-anchor": "end",
1139
+ "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
1140
+ "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
1141
+ fill: e.value.style.chart.grid.y.axisLabels.color,
1142
+ x: n.value.left - 8,
1143
+ y: n.value.top + d.value * l + d.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
1144
+ style: { cursor: "pointer" },
1145
+ onClick: () => ke(t, l),
1146
+ innerHTML: v($a)({
1147
+ content: String(t.text),
1148
+ fontSize: e.value.style.chart.grid.y.axisLabels.fontSize,
1149
+ fill: e.value.style.chart.grid.y.axisLabels.color,
1150
+ x: n.value.left - 8,
1151
+ y: 0
1152
+ })
1153
+ }, null, 8, Ml)) : (s(), o("text", {
1154
+ key: 0,
1155
+ "text-anchor": "end",
1156
+ "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
1157
+ "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
1158
+ fill: e.value.style.chart.grid.y.axisLabels.color,
1159
+ x: n.value.left - 8,
1160
+ y: n.value.top + d.value * l + d.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
1161
+ style: {
1162
+ cursor: "pointer"
1163
+ },
1164
+ onClick: () => ke(t, l)
1165
+ }, M(t.text), 9, Tl))
1166
+ ]))), 256))
1167
+ ]))
1168
+ ], 512)) : y("", !0),
1169
+ z.value.showTooltip && e.value.orientation === "vertical" ? (s(!0), o(g, { key: 16 }, m(h.value.end - h.value.start, (t, l) => (s(), o("rect", {
1170
+ x: n.value.left + l * d.value,
1171
+ y: n.value.top,
1172
+ width: d.value,
1173
+ height: n.value.height < 0 ? 0 : n.value.height,
1174
+ onClick: (c) => vt(l),
1175
+ onMouseenter: (c) => dt(l),
1176
+ onMouseleave: r[0] || (r[0] = (c) => {
1177
+ se.value = null, ue.value = !1;
1178
+ }),
1179
+ fill: l === se.value ? e.value.style.chart.highlighter.color : "transparent",
1180
+ style: Z({ opacity: e.value.style.chart.highlighter.opacity / 100 })
1181
+ }, null, 44, Al))), 256)) : y("", !0),
1182
+ z.value.showTooltip && e.value.orientation === "horizontal" ? (s(!0), o(g, { key: 17 }, m(h.value.end - h.value.start, (t, l) => (s(), o("rect", {
1183
+ x: n.value.left,
1184
+ y: n.value.top + l * d.value,
1185
+ width: n.value.width < 0 ? 0 : n.value.width,
1186
+ height: d.value,
1187
+ onClick: (c) => vt(l),
1188
+ onMouseenter: (c) => dt(l),
1189
+ onMouseleave: r[1] || (r[1] = (c) => {
1190
+ se.value = null, ue.value = !1;
1191
+ }),
1192
+ fill: l === se.value ? e.value.style.chart.highlighter.color : "transparent",
1193
+ style: Z({ opacity: e.value.style.chart.highlighter.opacity / 100 })
1194
+ }, null, 44, Nl))), 256)) : y("", !0),
1195
+ L(a.$slots, "svg", U(H({ ...n.value })), void 0, !0)
1196
+ ], 14, Ga)),
1197
+ a.$slots.watermark ? (s(), o("div", Il, [
1198
+ L(a.$slots, "watermark", U(H({ isPrinting: v(at) || v(lt) })), void 0, !0)
1199
+ ])) : y("", !0),
1200
+ Q("div", {
1201
+ ref_key: "chartSlicer",
1202
+ ref: Xe,
1203
+ style: Z(`width:100%;background:${e.value.style.chart.backgroundColor}`),
1204
+ "data-dom-to-png-ignore": ""
1205
+ }, [
1206
+ e.value.style.chart.zoom.show && F.value > 1 ? (s(), K(Ea, {
1207
+ ref_key: "slicerComponent",
1208
+ ref: ee,
1209
+ key: `slicer_${Je.value}`,
1210
+ background: e.value.style.chart.zoom.color,
1211
+ borderColor: e.value.style.chart.backgroundColor,
1212
+ fontSize: e.value.style.chart.zoom.fontSize,
1213
+ useResetSlot: e.value.style.chart.zoom.useResetSlot,
1214
+ labelLeft: e.value.style.chart.grid.x.timeLabels.values[h.value.start] ? $.value[0].text : "",
1215
+ labelRight: e.value.style.chart.grid.x.timeLabels.values[h.value.end - 1] ? $.value.at(-1).text : "",
1216
+ textColor: e.value.style.chart.color,
1217
+ inputColor: e.value.style.chart.zoom.color,
1218
+ selectColor: e.value.style.chart.zoom.highlightColor,
1219
+ max: Math.max(...Te.dataset.map((t) => t.series.length)),
1220
+ min: 0,
1221
+ valueStart: h.value.start,
1222
+ valueEnd: h.value.end,
1223
+ start: h.value.start,
1224
+ "onUpdate:start": r[2] || (r[2] = (t) => h.value.start = t),
1225
+ end: h.value.end,
1226
+ "onUpdate:end": r[3] || (r[3] = (t) => h.value.end = t),
1227
+ refreshStartPoint: e.value.style.chart.zoom.startIndex !== null ? e.value.style.chart.zoom.startIndex : 0,
1228
+ refreshEndPoint: e.value.style.chart.zoom.endIndex !== null ? e.value.style.chart.zoom.endIndex + 1 : Math.max(...Te.dataset.map((t) => t.series.length)),
1229
+ enableRangeHandles: e.value.style.chart.zoom.enableRangeHandles,
1230
+ enableSelectionDrag: e.value.style.chart.zoom.enableSelectionDrag,
1231
+ onReset: nt
1232
+ }, {
1233
+ "reset-action": C(({ reset: t }) => [
1234
+ L(a.$slots, "reset-action", U(H({ reset: t })), void 0, !0)
1235
+ ]),
1236
+ _: 3
1237
+ }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag"])) : y("", !0)
1238
+ ], 4),
1239
+ ze(v(Bt), {
1240
+ show: z.value.showTooltip && ue.value,
1241
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
1242
+ color: e.value.style.chart.tooltip.color,
1243
+ fontSize: e.value.style.chart.tooltip.fontSize,
1244
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
1245
+ borderColor: e.value.style.chart.tooltip.borderColor,
1246
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
1247
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
1248
+ position: e.value.style.chart.tooltip.position,
1249
+ offsetY: e.value.style.chart.tooltip.offsetY,
1250
+ parent: P.value,
1251
+ content: Ne.value,
1252
+ isFullscreen: ce.value,
1253
+ isCustom: v(Ot)(e.value.style.chart.tooltip.customFormat)
1254
+ }, {
1255
+ "tooltip-before": C(() => [
1256
+ L(a.$slots, "tooltip-before", U(H({ ...Ae.value })), void 0, !0)
1257
+ ]),
1258
+ "tooltip-after": C(() => [
1259
+ L(a.$slots, "tooltip-after", U(H({ ...Ae.value })), void 0, !0)
1260
+ ]),
1261
+ _: 3
1262
+ }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
1263
+ Q("div", {
1264
+ ref_key: "chartLegend",
1265
+ ref: Ye
1266
+ }, [
1267
+ e.value.style.chart.legend.show && ne.value ? (s(), K(Va, {
1268
+ key: 0,
1269
+ legendSet: xt.value,
1270
+ config: ra.value,
1271
+ onClickMarker: r[4] || (r[4] = ({ legend: t }) => t.segregate())
1272
+ }, $t({
1273
+ item: C(({ legend: t }) => [
1274
+ Q("div", {
1275
+ onClick: (l) => t.segregate(),
1276
+ style: Z(`opacity:${_.value.includes(t.id) ? 0.5 : 1}`)
1277
+ }, M(t.name), 13, Rl)
1278
+ ]),
1279
+ _: 2
1280
+ }, [
1281
+ a.$slots.pattern ? {
1282
+ name: "legend-pattern",
1283
+ fn: C(({ legend: t, index: l }) => [
1284
+ ze(Fa, {
1285
+ shape: t.shape,
1286
+ radius: 30,
1287
+ stroke: "none",
1288
+ plot: { x: 30, y: 30 },
1289
+ fill: `url(#pattern_${V.value}_${l})`
1290
+ }, null, 8, ["shape", "fill"])
1291
+ ]),
1292
+ key: "0"
1293
+ } : void 0
1294
+ ]), 1032, ["legendSet", "config"])) : L(a.$slots, "legend", {
1295
+ key: 1,
1296
+ legend: xt.value
1297
+ }, void 0, !0)
1298
+ ], 512),
1299
+ a.$slots.source ? (s(), o("div", {
1300
+ key: 4,
1301
+ ref_key: "source",
1302
+ ref: Ge,
1303
+ dir: "auto"
1304
+ }, [
1305
+ L(a.$slots, "source", {}, void 0, !0)
1306
+ ], 512)) : y("", !0),
1307
+ h.value.end - h.value.start < 200 ? (s(), K(v(Dt), {
1308
+ key: 5,
1309
+ hideDetails: "",
1310
+ config: {
1311
+ open: z.value.showTable,
1312
+ maxHeight: 1e4,
1313
+ body: {
1314
+ backgroundColor: e.value.style.chart.backgroundColor,
1315
+ color: e.value.style.chart.color
1316
+ },
1317
+ head: {
1318
+ backgroundColor: e.value.style.chart.backgroundColor,
1319
+ color: e.value.style.chart.color
1320
+ }
1321
+ }
1322
+ }, {
1323
+ content: C(() => [
1324
+ ze(v(Ft), {
1325
+ colNames: pe.value.colNames,
1326
+ head: pe.value.head,
1327
+ body: pe.value.body,
1328
+ config: pe.value.config,
1329
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
1330
+ onClose: r[5] || (r[5] = (t) => z.value.showTable = !1)
1331
+ }, {
1332
+ th: C(({ th: t }) => [
1333
+ Q("div", { innerHTML: t }, null, 8, Ol)
1334
+ ]),
1335
+ td: C(({ td: t }) => [
1336
+ fa(M(isNaN(Number(t)) ? t : v(j)({
1337
+ p: e.value.style.chart.bars.dataLabels.prefix,
1338
+ v: t,
1339
+ s: e.value.style.chart.bars.dataLabels.suffix,
1340
+ r: e.value.table.td.roundingValue
1341
+ })), 1)
1342
+ ]),
1343
+ _: 1
1344
+ }, 8, ["colNames", "head", "body", "config", "title"])
1345
+ ]),
1346
+ _: 1
1347
+ }, 8, ["config"])) : y("", !0),
1348
+ v(he) ? (s(), K(Wa, { key: 6 })) : y("", !0)
1349
+ ], 46, Xa));
1350
+ }
1351
+ }, jl = /* @__PURE__ */ Ya(Pl, [["__scopeId", "data-v-4f72a346"]]);
1352
+ export {
1353
+ jl as default
1354
+ };