vue-data-ui 3.1.7 → 3.1.9

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 (92) hide show
  1. package/dist/{Arrow-BZ8rnWYn.js → Arrow-Bd2Nv1JR.js} +1 -1
  2. package/dist/{BaseDraggableDialog-Bdva4JFr.js → BaseDraggableDialog-DnDgu3fu.js} +2 -2
  3. package/dist/{BaseIcon-BCS8aIf4.js → BaseIcon-ClWpJKO3.js} +1 -1
  4. package/dist/{ColorPicker-DF6PDOhr.js → ColorPicker-CGqCY0f7.js} +2 -2
  5. package/dist/{DataTable-Ddu14t59.js → DataTable-BeFHXTQb.js} +2 -2
  6. package/dist/{Legend-C3I0iaLM.js → Legend-D_ryPoDQ.js} +2 -2
  7. package/dist/{NonSvgPenAndPaper-LSG0MLRC.js → NonSvgPenAndPaper-C0fUFsd1.js} +3 -3
  8. package/dist/{PackageVersion-CtYY8jBZ.js → PackageVersion-nvqupdcz.js} +1 -1
  9. package/dist/{PenAndPaper-DtlEAsLw.js → PenAndPaper-CdK_W5h2.js} +3 -3
  10. package/dist/{Shape-B8Cdu8s1.js → Shape-g1_KwK3i.js} +1 -1
  11. package/dist/Slicer-BbsnAAIT.js +972 -0
  12. package/dist/{SparkTooltip-qMi3IzXb.js → SparkTooltip-BJY8zi7K.js} +1 -1
  13. package/dist/{Title-BUVvr0U8.js → Title-DCLc6TCZ.js} +1 -1
  14. package/dist/{Tooltip-VlJQQsYu.js → Tooltip-DI84H3Yz.js} +1 -1
  15. package/dist/{UserOptions-sSygisu3.js → UserOptions-2XI1AOh5.js} +2 -2
  16. package/dist/{dom-to-png-BqX4MBZN.js → dom-to-png-BbsbFKuu.js} +1 -1
  17. package/dist/{img-DN0--Lx6.js → img-DQnzQcOw.js} +1 -1
  18. package/dist/{index-BlRUhv0O.js → index-5vhIMiMJ.js} +123 -118
  19. package/dist/{pdf-Cm5HZB7J.js → pdf-BbD1z_VM.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/vue-data-ui.d.cts +6 -0
  22. package/dist/types/vue-data-ui.d.ts +6 -0
  23. package/dist/{useAutoSizeLabelsInsideViewbox-wLT3gJAJ.js → useAutoSizeLabelsInsideViewbox-lO6KBU08.js} +1 -1
  24. package/dist/{useNestedProp-OxTlfHdh.js → useNestedProp-BBcJUXV-.js} +1 -1
  25. package/dist/{usePrinter-DR__HfSR.js → usePrinter-BxQRVOJV.js} +2 -2
  26. package/dist/{vue-data-ui-Ci8pH3va.js → vue-data-ui-CBSwx9_2.js} +64 -64
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-h-8AQQKD.js → vue-ui-3d-bar-DrVQXElH.js} +6 -6
  29. package/dist/{vue-ui-accordion-DejV6zJ2.js → vue-ui-accordion-CWkuC41h.js} +3 -3
  30. package/dist/{vue-ui-age-pyramid-yTcDoeqi.js → vue-ui-age-pyramid-hfNlu-eT.js} +6 -6
  31. package/dist/{vue-ui-annotator-HqsIz-FI.js → vue-ui-annotator-BdW7stIX.js} +2 -2
  32. package/dist/{vue-ui-bullet-Co4ZttnE.js → vue-ui-bullet-DH55M9hd.js} +7 -7
  33. package/dist/{vue-ui-candlestick-BQQR9K33.js → vue-ui-candlestick-BdCIu_3Z.js} +7 -7
  34. package/dist/{vue-ui-carousel-table-BzDik-6R.js → vue-ui-carousel-table-CYFqd5Do.js} +4 -4
  35. package/dist/{vue-ui-chestnut-5VG75w-T.js → vue-ui-chestnut-BAXJvE_P.js} +5 -5
  36. package/dist/{vue-ui-chord-5HE-ZTDA.js → vue-ui-chord-CZvpyXPS.js} +8 -8
  37. package/dist/{vue-ui-circle-pack-BVcr-3fG.js → vue-ui-circle-pack-DIrNW31y.js} +6 -6
  38. package/dist/{vue-ui-cursor-BDH4YPCA.js → vue-ui-cursor-DB5jBNc-.js} +2 -2
  39. package/dist/{vue-ui-dashboard-VtafJ36J.js → vue-ui-dashboard-NIsI1tyR.js} +67 -67
  40. package/dist/{vue-ui-digits-Bh5fmCge.js → vue-ui-digits-D1E8vS1U.js} +2 -2
  41. package/dist/{vue-ui-donut-PiILi3WQ.js → vue-ui-donut-Dcc640KU.js} +8 -8
  42. package/dist/{vue-ui-donut-evolution-DVp2UID9.js → vue-ui-donut-evolution-FvABIk1B.js} +8 -8
  43. package/dist/{vue-ui-dumbbell-DIX_gcC_.js → vue-ui-dumbbell-DwR1pCUC.js} +7 -7
  44. package/dist/{vue-ui-flow-DY64szfV.js → vue-ui-flow-DAm9A_0v.js} +7 -7
  45. package/dist/{vue-ui-funnel-DnQFZe9P.js → vue-ui-funnel-CBzrS5BO.js} +6 -6
  46. package/dist/{vue-ui-galaxy-C0TCFGXT.js → vue-ui-galaxy-IJ_oreeF.js} +7 -7
  47. package/dist/{vue-ui-gauge-BNIAJlUC.js → vue-ui-gauge-o72yvW6N.js} +7 -7
  48. package/dist/{vue-ui-gizmo-BnHruhLB.js → vue-ui-gizmo-DfyGDDpf.js} +3 -3
  49. package/dist/{vue-ui-heatmap-CH_twICb.js → vue-ui-heatmap-BGCYDLeT.js} +7 -7
  50. package/dist/{vue-ui-history-plot-CtJrkyG8.js → vue-ui-history-plot-WM4e1JlT.js} +7 -7
  51. package/dist/{vue-ui-kpi-Co0app61.js → vue-ui-kpi-BcDpOVCW.js} +3 -3
  52. package/dist/{vue-ui-mini-loader-DXrdP_7p.js → vue-ui-mini-loader-pv8BRyQQ.js} +2 -2
  53. package/dist/{vue-ui-molecule-C2cNArDQ.js → vue-ui-molecule-D7oF0j_4.js} +5 -5
  54. package/dist/{vue-ui-mood-radar-BrLLsYz5.js → vue-ui-mood-radar-iPbyJzps.js} +7 -7
  55. package/dist/{vue-ui-nested-donuts-DRysa4v_.js → vue-ui-nested-donuts-BLceuaiq.js} +9 -10
  56. package/dist/{vue-ui-onion-znQ-OGaR.js → vue-ui-onion-Dnf_fWQJ.js} +8 -8
  57. package/dist/{vue-ui-parallel-coordinate-plot-DIX2Hytk.js → vue-ui-parallel-coordinate-plot-DgqvrE6i.js} +8 -8
  58. package/dist/{vue-ui-quadrant-B4X5ePQQ.js → vue-ui-quadrant-B7_t3c1D.js} +8 -8
  59. package/dist/{vue-ui-quick-chart-Cm7iAsdB.js → vue-ui-quick-chart-QBNsaoSx.js} +606 -582
  60. package/dist/{vue-ui-radar-CMXnDLdC.js → vue-ui-radar-B5LY3bFz.js} +8 -8
  61. package/dist/{vue-ui-rating-wAMAKVA8.js → vue-ui-rating-M2LsJhF9.js} +2 -2
  62. package/dist/{vue-ui-relation-circle-snHKlhA3.js → vue-ui-relation-circle-BDgDf-UH.js} +7 -7
  63. package/dist/{vue-ui-ridgeline-Bx7_nnJ7.js → vue-ui-ridgeline-CF8EGKmN.js} +8 -8
  64. package/dist/{vue-ui-rings-BGTPLeaD.js → vue-ui-rings-CEf32Qd9.js} +8 -8
  65. package/dist/{vue-ui-scatter-D-rI3hK1.js → vue-ui-scatter-B1Aafuh6.js} +8 -8
  66. package/dist/{vue-ui-skeleton-B-6lN9xS.js → vue-ui-skeleton-DCf8RHTA.js} +3 -3
  67. package/dist/{vue-ui-smiley-DeLEE9m9.js → vue-ui-smiley-D9TyN2I4.js} +2 -2
  68. package/dist/{vue-ui-spark-trend-BvrboxYt.js → vue-ui-spark-trend-DcZNamSY.js} +3 -3
  69. package/dist/{vue-ui-sparkbar-nW5DeWC5.js → vue-ui-sparkbar-CNmySZRR.js} +3 -3
  70. package/dist/{vue-ui-sparkgauge-Isge2K7-.js → vue-ui-sparkgauge-Du3pqhHb.js} +3 -3
  71. package/dist/{vue-ui-sparkhistogram-ChSw4gHY.js → vue-ui-sparkhistogram-DY33-6pA.js} +4 -4
  72. package/dist/{vue-ui-sparkline-DH-VRt5o.js → vue-ui-sparkline-DQO2IGma.js} +3 -3
  73. package/dist/{vue-ui-sparkstackbar-l45aaRR1.js → vue-ui-sparkstackbar-BHgX0FAK.js} +3 -3
  74. package/dist/{vue-ui-stackbar-ByVq83Og.js → vue-ui-stackbar-DTvmplPR.js} +9 -9
  75. package/dist/{vue-ui-strip-plot-CwooqV7G.js → vue-ui-strip-plot-CH3BNHOX.js} +7 -7
  76. package/dist/{vue-ui-table-BRPcCRq-.js → vue-ui-table-DmOi42QJ.js} +554 -520
  77. package/dist/{vue-ui-table-heatmap-CaAadUo0.js → vue-ui-table-heatmap-D0XRMZEF.js} +5 -5
  78. package/dist/{vue-ui-table-sparkline-Bt7VtPKK.js → vue-ui-table-sparkline-SjzOqua1.js} +4 -4
  79. package/dist/{vue-ui-thermometer-B-CWjknr.js → vue-ui-thermometer-Dkb9wTy_.js} +7 -7
  80. package/dist/{vue-ui-timer-CxLcOKNv.js → vue-ui-timer-CeCAWDqf.js} +5 -5
  81. package/dist/{vue-ui-tiremarks-DYEZvwDv.js → vue-ui-tiremarks-B9XkzHFy.js} +6 -6
  82. package/dist/{vue-ui-treemap-CeuebtPa.js → vue-ui-treemap-BCcXO9kM.js} +8 -8
  83. package/dist/{vue-ui-vertical-bar-D8_txlgd.js → vue-ui-vertical-bar-CRtBBzYM.js} +9 -9
  84. package/dist/{vue-ui-waffle-B5Qe5PKA.js → vue-ui-waffle-DSNBPqTC.js} +8 -8
  85. package/dist/{vue-ui-wheel-CxpLOCGw.js → vue-ui-wheel-BXQK9I22.js} +6 -6
  86. package/dist/{vue-ui-word-cloud-DCoL3uD5.js → vue-ui-word-cloud-YLIzbhcv.js} +6 -6
  87. package/dist/{vue-ui-world-DmnwTNAv.js → vue-ui-world-eCTtZria.js} +6 -6
  88. package/dist/vue-ui-xy-C7u7xEoN.js +4507 -0
  89. package/dist/{vue-ui-xy-canvas-CJp0mlzr.js → vue-ui-xy-canvas-D_rqJLcT.js} +10 -10
  90. package/package.json +1 -1
  91. package/dist/Slicer-Bk01kWGC.js +0 -596
  92. package/dist/vue-ui-xy-CzdchisK.js +0 -4141
@@ -1,4141 +0,0 @@
1
- import { useCssVars as Fo, computed as x, ref as g, onMounted as il, onBeforeUnmount as Xt, watch as it, nextTick as Yt, onUpdated as Po, createElementBlock as r, openBlock as s, createElementVNode as y, createCommentVNode as f, renderSlot as K, normalizeStyle as _, createVNode as Wt, withDirectives as ia, unref as v, Fragment as b, renderList as C, normalizeClass as Xe, withKeys as Ya, vModelText as Ga, toDisplayString as ne, defineAsyncComponent as Ct, useSlots as Oo, getCurrentInstance as Bo, toRefs as Ho, watchEffect as Ua, createBlock as Je, createSlots as qa, withCtx as be, normalizeProps as At, guardReactiveProps as zt, mergeProps as Vt, Teleport as Vo, resolveDynamicComponent as Eo, vModelCheckbox as Do, createTextVNode as Za } from "vue";
2
- import { c as Dl, V as Xl, U as Yl, y as Wl, X as Wo, F as ut, u as Xo, f as oa, t as Yo, d as Go, D as Ml, ac as Et, e as Uo, p as qo, ad as Hl, a9 as Z, a4 as na, ae as Zo, h as W, af as Ka, ag as Ja, ah as Ko, ai as Qa, aj as ja, k as Le, ak as Jo, z as Qo, _ as eo, R as dt, i as Qe, x as Dt, s as nt, a7 as le, L as jo, al as Vl, I as en, am as Tt, C as We, a as tn, b as ln, o as to, v as an, w as on, E as ul } from "./index-BlRUhv0O.js";
3
- import { t as sa, u as nn } from "./useResponsive-DfdjqQps.js";
4
- import { u as un } from "./usePrinter-DR__HfSR.js";
5
- import { u as sn, B as rn } from "./BaseScanner-BgWxam9d.js";
6
- import { u as lo, a as cn, l as vn } from "./useTimeLabels-BGFjWgrv.js";
7
- import { u as ua } from "./useNestedProp-OxTlfHdh.js";
8
- import { u as dn } from "./useTimeLabelCollider-CIsgDrl9.js";
9
- import hn from "./img-DN0--Lx6.js";
10
- import fn from "./Title-BUVvr0U8.js";
11
- import { S as mn } from "./Slicer-Bk01kWGC.js";
12
- import { _ as El } from "./Shape-B8Cdu8s1.js";
13
- import gn from "./BaseIcon-BCS8aIf4.js";
14
- import { _ as ao } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
- import bn from "./vue-ui-accordion-DejV6zJ2.js";
16
- const xn = {
17
- class: "vue-data-ui-slicer-labels",
18
- style: { position: "relative", "z-index": "1", "pointer-events": "none" }
19
- }, pn = {
20
- key: 0,
21
- style: { width: "100%", position: "relative" }
22
- }, yn = {
23
- key: 0,
24
- class: "minimap",
25
- style: { width: "100%" }
26
- }, kn = ["xmlns", "viewBox"], wn = ["id"], Sn = ["stop-color"], _n = ["d", "stroke"], $n = ["x", "width", "height", "fill", "rx"], Ln = ["d", "fill"], Mn = ["x", "width", "height", "rx", "fill"], Cn = ["x", "width", "height", "fill", "rx"], An = ["d", "fill"], zn = ["d", "stroke"], Tn = ["cx", "cy", "stroke", "fill"], In = ["cx", "cy", "stroke", "fill"], Nn = ["x1", "x2", "y2", "stroke"], Rn = ["x", "height", "width", "onMouseenter"], Fn = ["min", "max"], Pn = ["min", "max"], On = 48, Bn = {
27
- __name: "SlicerPreview",
28
- props: {
29
- background: {
30
- type: String,
31
- default: "#FFFFFF"
32
- },
33
- borderColor: {
34
- type: String,
35
- default: "#FFFFFF"
36
- },
37
- fontSize: {
38
- type: Number,
39
- default: 14
40
- },
41
- labelLeft: {
42
- type: [String, Number],
43
- default: ""
44
- },
45
- labelRight: {
46
- type: [String, Number],
47
- default: ""
48
- },
49
- textColor: {
50
- type: String,
51
- default: "#1A1A1A"
52
- },
53
- inputColor: {
54
- type: String,
55
- default: "#1A1A1A"
56
- },
57
- max: {
58
- type: Number,
59
- default: 0
60
- },
61
- min: {
62
- type: Number,
63
- default: 0
64
- },
65
- selectColor: {
66
- type: String,
67
- default: "#4A4A4A"
68
- },
69
- useResetSlot: {
70
- type: Boolean,
71
- default: !1
72
- },
73
- valueStart: {
74
- type: [Number, String],
75
- default: 0
76
- },
77
- valueEnd: {
78
- type: [Number, String],
79
- default: 0
80
- },
81
- minimap: {
82
- type: Array,
83
- default: []
84
- },
85
- smoothMinimap: {
86
- type: Boolean,
87
- default: !1
88
- },
89
- minimapSelectedColor: {
90
- type: String,
91
- default: "#1f77b4"
92
- },
93
- minimapSelectionRadius: {
94
- type: Number,
95
- default: 12
96
- },
97
- minimapLineColor: {
98
- type: String,
99
- default: "#2D353C"
100
- },
101
- minimapSelectedColorOpacity: {
102
- type: Number,
103
- default: 0.2
104
- },
105
- minimapSelectedIndex: {
106
- type: Number,
107
- default: null
108
- },
109
- minimapIndicatorColor: {
110
- type: String,
111
- default: "#2D353C"
112
- },
113
- refreshStartPoint: {
114
- type: Number,
115
- default: 0
116
- },
117
- refreshEndPoint: {
118
- type: Number,
119
- default: null
120
- },
121
- enableRangeHandles: {
122
- type: Boolean,
123
- default: !1
124
- },
125
- enableSelectionDrag: {
126
- type: Boolean,
127
- default: !0
128
- },
129
- verticalHandles: {
130
- type: Boolean,
131
- default: !1
132
- },
133
- timeLabels: {
134
- type: Array
135
- },
136
- isPreview: {
137
- type: Boolean,
138
- default: !1
139
- },
140
- preciseLabels: {
141
- type: Array,
142
- default() {
143
- return [];
144
- }
145
- },
146
- usePreciseLabels: {
147
- type: Boolean,
148
- default: !1
149
- },
150
- selectedSeries: {
151
- type: Object
152
- },
153
- customFormat: {
154
- type: [Function, null]
155
- }
156
- },
157
- emits: ["futureStart", "futureEnd", "update:start", "update:end", "reset", "trapMouse"],
158
- setup(N, { expose: Gl, emit: Ul }) {
159
- Fo((m) => ({
160
- fd69940c: It.value,
161
- "1940be6e": Ge.value,
162
- "540b7d42": ql.value,
163
- "0d1400c4": N.selectColor,
164
- "40456b2c": Nt.value
165
- }));
166
- const d = N, Ye = g(null), ve = g(d.min), de = g(d.max), kt = x(() => !!d.minimap.length), sl = g(Dl()), Gt = g(!1), rl = g(0), Ut = x({
167
- get() {
168
- return ve.value;
169
- },
170
- set(m) {
171
- const h = Math.min(m, de.value - 1);
172
- ve.value = h, ue.value && (ue.value.value = String(h)), xe("futureStart", h);
173
- }
174
- }), wt = x({
175
- get() {
176
- return de.value;
177
- },
178
- set(m) {
179
- const h = Math.max(m, ve.value + 1);
180
- de.value = h, Y.value && (Y.value.value = String(h)), xe("futureEnd", h);
181
- }
182
- });
183
- il(() => {
184
- const m = () => {
185
- Ye.value && (rl.value = Ye.value.getBoundingClientRect().width);
186
- };
187
- m();
188
- const h = sa(m, 50);
189
- window.addEventListener("resize", h), Xt(() => {
190
- window.removeEventListener("resize", h);
191
- });
192
- });
193
- let cl = null;
194
- function je() {
195
- clearTimeout(cl), xe("update:start", Number(ve.value)), xe("update:end", Number(de.value)), Gt.value = !1;
196
- }
197
- const vl = x(() => d.refreshEndPoint === null ? d.max : d.refreshEndPoint), xe = Ul, pe = x(() => {
198
- const m = d.max - d.min, h = (ve.value - d.min) / m * 100, S = (de.value - d.min) / m * 100, X = (h + S) / 2, ce = st.value ? `calc(${X}% - ${vt.value.width}px)` : He.value ? `calc(${X}%)` : `calc(${X}% - ${vt.value.width / 2}px)`;
199
- return {
200
- left: `${h}%`,
201
- width: `${S - h}%`,
202
- background: d.selectColor,
203
- tooltipLeft: `calc(${h}% - ${He.value ? 0 : yl.value / 2}px)`,
204
- tooltipRight: `calc(${S}% - ${st.value ? el.value : el.value / 2}px)`,
205
- tooltipCenter: ce,
206
- arrowLeft: !He.value,
207
- arrowRight: !st.value
208
- };
209
- }), He = x(() => Ye.value ? Ye.value.getBoundingClientRect().width * ((ve.value - d.min) / (d.max - d.min)) - yl.value / 2 < 0 : !1), st = x(() => Ye.value ? Ye.value.getBoundingClientRect().width * ((de.value - d.min) / (d.max - d.min)) + el.value / 2 > Ye.value.getBoundingClientRect().width : !1), It = x(() => d.inputColor), Nt = x(() => d.background), ql = x(() => `${d.selectColor}33`), Ge = x(() => d.borderColor), qt = x(() => {
210
- let m = [];
211
- for (let h = 0; h < d.minimap.length; h += 1)
212
- m.push(h);
213
- return m;
214
- });
215
- function ht() {
216
- xe("reset");
217
- }
218
- it(
219
- () => d.min,
220
- (m) => {
221
- Number(ve.value) < Number(m) && (ve.value = Number(m)), Number(de.value) < Number(m) && (de.value = Number(m));
222
- }
223
- ), it(
224
- () => d.max,
225
- (m) => {
226
- Number(ve.value) > Number(m) && (ve.value = Number(m)), Number(de.value) > Number(m) && (de.value = Number(m));
227
- }
228
- );
229
- const Rt = g(null), j = g({
230
- width: 1,
231
- height: 1
232
- }), Me = g(null);
233
- il(() => {
234
- if (kt.value) {
235
- const m = sa(() => {
236
- const { width: h, height: S } = nn({
237
- chart: Rt.value
238
- });
239
- j.value.width = h, j.value.height = S - 47;
240
- });
241
- Me.value = new ResizeObserver(m), Me.value.observe(Rt.value);
242
- }
243
- }), Xt(() => {
244
- Me.value && Me.value.disconnect();
245
- });
246
- const dl = x(() => Math.max(1, d.max - d.min)), St = x(() => Math.max(1, d.minimap.length)), P = x(() => St.value / dl.value);
247
- function hl(m) {
248
- const h = Math.floor((m - d.min) * P.value);
249
- return Math.min(Math.max(0, h), St.value);
250
- }
251
- function ye(m) {
252
- const h = Math.ceil((m - d.min) * P.value);
253
- return Math.min(Math.max(0, h), St.value);
254
- }
255
- const ee = x(() => hl(ve.value)), rt = x(() => ye(de.value)), ke = x(() => d.minimap.length ? j.value.width / d.minimap.length : 0), we = x(() => {
256
- if (!d.minimap.length) return [];
257
- const m = Math.max(...d.minimap), h = Math.min(...d.minimap) - 10, S = m - (h > 0 ? 0 : h), X = d.minimap.map((at, Ze) => ({
258
- x: j.value.width / d.minimap.length * Ze + ke.value / 2,
259
- y: j.value.height - (at - h) / S * (j.value.height * 0.9)
260
- })), ce = ee.value, xt = Math.max(ce + 1, rt.value), ll = d.smoothMinimap ? Xl(X) : Yl(X), Te = X.slice(ce, xt), Ft = d.smoothMinimap ? Xl(Te) : Yl(Te);
261
- return {
262
- fullSet: ll,
263
- selectionSet: Ft,
264
- sliced: Te,
265
- firstPlot: X[ce],
266
- lastPlot: X[Math.max(0, xt - 1)]
267
- };
268
- }), Ce = x(() => {
269
- const m = ee.value, h = Math.max(m + 1, rt.value);
270
- return {
271
- x: ke.value * m + ke.value / 2,
272
- width: ke.value * (h - m) - ke.value
273
- };
274
- }), Re = g(d.minimapSelectedIndex);
275
- it(() => d.minimapSelectedIndex, (m) => {
276
- if ([null, void 0].includes(m)) {
277
- Re.value = null;
278
- return;
279
- }
280
- Re.value = hl(d.valueStart) + m;
281
- }, { immediate: !0 });
282
- function Cl(m) {
283
- Re.value = m;
284
- const h = ee.value, S = rt.value;
285
- m >= h && m < S && xe("trapMouse", m - h);
286
- }
287
- const ft = g(0), ue = g(null), Y = g(null);
288
- function fl(m) {
289
- if (typeof m == "object" && m && "target" in m) {
290
- const S = m.target, X = "valueAsNumber" in S ? S.valueAsNumber : +S.value;
291
- return Number.isFinite(X) ? X : NaN;
292
- }
293
- const h = +m;
294
- return Number.isFinite(h) ? h : NaN;
295
- }
296
- let Zt = 0;
297
- function ml(m) {
298
- Gt.value = !0;
299
- const h = fl(m);
300
- Number.isFinite(h) && (cancelAnimationFrame(Zt), Zt = requestAnimationFrame(() => {
301
- Ut.value = h;
302
- }));
303
- }
304
- let mt = 0;
305
- function Kt(m) {
306
- Gt.value = !0;
307
- const h = fl(m);
308
- Number.isFinite(h) && (cancelAnimationFrame(mt), mt = requestAnimationFrame(() => {
309
- wt.value = h;
310
- }));
311
- }
312
- Xt(() => {
313
- cancelAnimationFrame(Zt), cancelAnimationFrame(mt);
314
- });
315
- const O = x(() => d.valueEnd - d.valueStart), gt = g(!1);
316
- let gl = g(null);
317
- const Jt = x(() => (rl.value - 48) / (d.max - d.min) * O.value), Ae = x(() => Math.max(1, rl.value - On - Jt.value)), et = x(() => Math.max(1, d.max - d.min - O.value)), Qt = x(() => et.value / Ae.value), bl = g(0), bt = g(0), L = g(0), Al = g(0);
318
- let tt = null, Ue = null, lt = null, w = null;
319
- const Fe = (m) => {
320
- if (Se.value = !0, !d.enableSelectionDrag) return;
321
- const h = m.type === "touchstart";
322
- h || m.stopPropagation();
323
- const S = h && m.targetTouches && m.targetTouches[0] ? m.targetTouches[0] : null, X = h ? S ? S.target : null : m.target;
324
- if (!X || !(X instanceof Element) || X.classList && X.classList.contains("range-handle")) return;
325
- gt.value = !0;
326
- const ce = h ? S ? S.clientX : 0 : m.clientX;
327
- gl.value = ce, bl.value = ce, bt.value = ve.value, L.value = de.value, Al.value = Qt.value, tt = h ? "touchmove" : "mousemove", Ue = h ? "touchend" : "mouseup", lt = h ? jt : xl, w = h ? pl : k, window.addEventListener(tt, lt, { passive: !1 }), window.addEventListener(Ue, w);
328
- };
329
- function xl(m) {
330
- gt.value && t(m.clientX);
331
- }
332
- function jt(m) {
333
- if (!gt.value || !Ye.value) return;
334
- const h = m.target;
335
- if (!(h instanceof Element) || !Ye.value.contains(h) || h.classList && h.classList.contains("range-handle")) return;
336
- m.preventDefault();
337
- const S = m.targetTouches && m.targetTouches[0] ? m.targetTouches[0] : null;
338
- S && t(S.clientX);
339
- }
340
- function t(m) {
341
- if (!gt.value) return;
342
- const S = (m - bl.value) * Al.value;
343
- let X = Math.round(bt.value + S);
344
- X = Math.max(d.min, Math.min(X, d.max - O.value));
345
- const ce = X + O.value;
346
- Ut.value = X, wt.value = ce;
347
- }
348
- function k() {
349
- _t();
350
- }
351
- function pl() {
352
- _t();
353
- }
354
- function _t() {
355
- gt.value = !1, tt && lt && window.removeEventListener(tt, lt), Ue && w && window.removeEventListener(Ue, w), tt = Ue = null, lt = w = null, je();
356
- }
357
- const oe = g(!1), he = g(null), ct = g(null), yl = g(1), el = g(1), Se = g(!1);
358
- function ze() {
359
- he.value && (yl.value = he.value.getBoundingClientRect().width);
360
- }
361
- function p() {
362
- ct.value && (el.value = ct.value.getBoundingClientRect().width);
363
- }
364
- const qe = g(0);
365
- function kl(m) {
366
- qe.value = m === "start" ? 1 : 0;
367
- }
368
- const $t = g(!1), vt = g({
369
- width: 0,
370
- left: 0
371
- });
372
- it([ve, de], async () => {
373
- if (await Yt(), !he.value || !ct.value) {
374
- $t.value = !1, vt.value = { width: 0, left: 0 };
375
- return;
376
- }
377
- const m = he.value.getBoundingClientRect(), h = ct.value.getBoundingClientRect();
378
- $t.value = m.x + m.width > h.x;
379
- const S = m.x + m.width / 2, X = h.x + h.width / 2, ce = m.width + h.width, xt = (S + X) / 2;
380
- vt.value = {
381
- width: ce,
382
- left: xt - ce / 2
383
- };
384
- }), Po(() => {
385
- ze(), p();
386
- }), it(() => d.labelLeft, () => {
387
- Yt(ze);
388
- }, { deep: !0 }), it(() => d.labelRight, () => {
389
- Yt(p);
390
- }, { deep: !0 });
391
- const tl = g(!1), ie = x(() => {
392
- let m = { text: "" }, h = { text: "" };
393
- if (tl.value = !1, Wl(d.customFormat))
394
- try {
395
- const S = d.customFormat({
396
- absoluteIndex: ve.value,
397
- seriesIndex: ve.value,
398
- datapoint: d.selectedSeries
399
- }), X = d.customFormat({
400
- absoluteIndex: de.value - 1,
401
- seriesIndex: de.value - 1,
402
- datapoint: d.selectedSeries
403
- });
404
- typeof S == "string" && typeof X == "string" && (m.text = S, h.text = X, tl.value = !0);
405
- } catch {
406
- console.warn("Custom format cannot be applied on zoom labels."), tl.value = !1;
407
- }
408
- return tl.value || (m = d.usePreciseLabels ? d.preciseLabels.find((S) => S.absoluteIndex === ve.value) : d.timeLabels.find((S) => S.absoluteIndex === ve.value), h = d.usePreciseLabels ? d.preciseLabels.find((S) => S.absoluteIndex === de.value - 1) : d.timeLabels.find((S) => S.absoluteIndex === de.value - 1)), {
409
- left: m ? m.text : "",
410
- right: h ? h.text : ""
411
- };
412
- });
413
- return Xt(() => {
414
- Me.value && Me.value.disconnect(), tt && lt && window.removeEventListener(tt, lt), Ue && w && window.removeEventListener(Ue, w), tt = Ue = null, lt = w = null, clearTimeout(cl);
415
- }), Gl({
416
- setStartValue: ml,
417
- setEndValue: Kt
418
- }), (m, h) => (s(), r("div", {
419
- "data-dom-to-png-ignore": "",
420
- style: { padding: "0 24px" },
421
- class: "vue-data-ui-zoom",
422
- ref_key: "zoomWrapper",
423
- ref: Ye,
424
- onMousedown: Fe,
425
- onTouchstart: Fe
426
- }, [
427
- y("div", xn, [
428
- N.valueStart !== N.refreshStartPoint || N.valueEnd !== vl.value ? (s(), r("div", pn, [
429
- N.useResetSlot ? K(m.$slots, "reset-action", {
430
- key: 1,
431
- reset: ht
432
- }, void 0, !0) : (s(), r("button", {
433
- key: 0,
434
- tabindex: "0",
435
- role: "button",
436
- class: "vue-data-ui-refresh-button",
437
- style: _({
438
- top: kt.value ? "36px" : "-16px",
439
- pointerEvents: "all !important"
440
- }),
441
- onClick: ht
442
- }, [
443
- Wt(gn, {
444
- name: "refresh",
445
- stroke: N.textColor
446
- }, null, 8, ["stroke"])
447
- ], 4))
448
- ])) : f("", !0)
449
- ]),
450
- y("div", {
451
- class: "double-range-slider",
452
- ref_key: "minimapWrapper",
453
- ref: Rt,
454
- style: { "z-index": "0" },
455
- onMouseenter: h[11] || (h[11] = (S) => Se.value = !0),
456
- onMouseleave: h[12] || (h[12] = (S) => Se.value = !1)
457
- }, [
458
- kt.value ? (s(), r("div", yn, [
459
- (s(), r("svg", {
460
- xmlns: v(Wo),
461
- viewBox: `0 0 ${j.value.width < 0 ? 0 : j.value.width} ${j.value.height < 0 ? 0 : j.value.height}`
462
- }, [
463
- y("defs", null, [
464
- y("linearGradient", {
465
- id: sl.value,
466
- x1: "0%",
467
- y1: "0%",
468
- x2: "0%",
469
- y2: "100%"
470
- }, [
471
- y("stop", {
472
- offset: "0%",
473
- "stop-color": `${N.minimapLineColor}50`
474
- }, null, 8, Sn),
475
- h[13] || (h[13] = y("stop", {
476
- offset: "100%",
477
- "stop-color": "transparent"
478
- }, null, -1))
479
- ], 8, wn)
480
- ]),
481
- y("path", {
482
- d: `M${we.value.fullSet}`,
483
- stroke: `${N.minimapLineColor}`,
484
- fill: "none",
485
- "stroke-width": "1",
486
- "stroke-linecap": "round",
487
- "stroke-linejoin": "round",
488
- style: { opacity: "1" }
489
- }, null, 8, _n),
490
- y("rect", {
491
- x: Ce.value.x,
492
- y: 0,
493
- width: Ce.value.width < 0 ? 0 : Ce.value.width,
494
- height: Math.max(j.value.height, 0),
495
- fill: Ge.value,
496
- rx: N.minimapSelectionRadius,
497
- stroke: "none"
498
- }, null, 8, $n),
499
- y("path", {
500
- d: `M${ke.value / 2},${Math.max(j.value.height, 0)} ${we.value.fullSet} L${j.value.width - ke.value / 2},${Math.max(j.value.height, 0)}Z`,
501
- fill: `url(#${sl.value})`,
502
- stroke: "none",
503
- style: { opacity: "1" }
504
- }, null, 8, Ln),
505
- y("rect", {
506
- x: Ce.value.x,
507
- y: 0,
508
- width: Ce.value.width < 0 ? 0 : Ce.value.width,
509
- height: Math.max(j.value.height, 0),
510
- rx: N.minimapSelectionRadius,
511
- fill: Ge.value,
512
- style: _({ opacity: gt.value || Gt.value ? 0 : 1 })
513
- }, null, 12, Mn),
514
- y("rect", {
515
- x: Ce.value.x,
516
- y: 0,
517
- width: Ce.value.width < 0 ? 0 : Ce.value.width,
518
- height: Math.max(j.value.height, 0),
519
- fill: N.minimapSelectedColor,
520
- rx: N.minimapSelectionRadius,
521
- style: _({ opacity: N.minimapSelectedColorOpacity })
522
- }, null, 12, Cn),
523
- y("path", {
524
- d: `M${we.value.sliced[0].x},${Math.max(j.value.height, 0)} ${we.value.selectionSet} L${we.value.sliced.at(-1).x},${Math.max(j.value.height, 0)}Z`,
525
- fill: `url(#${sl.value})`,
526
- stroke: "none",
527
- style: { opacity: "1" }
528
- }, null, 8, An),
529
- y("path", {
530
- d: `M ${we.value.selectionSet}`,
531
- stroke: `${N.minimapLineColor}`,
532
- fill: "transparent",
533
- "stroke-width": "2",
534
- "stroke-linecap": "round",
535
- "stroke-linejoin": "round"
536
- }, null, 8, zn),
537
- y("circle", {
538
- cx: we.value.firstPlot.x,
539
- cy: we.value.firstPlot.y,
540
- "stroke-width": "0.5",
541
- stroke: Ge.value,
542
- r: "3",
543
- fill: N.minimapLineColor
544
- }, null, 8, Tn),
545
- y("circle", {
546
- cx: we.value.lastPlot.x,
547
- cy: we.value.lastPlot.y,
548
- "stroke-width": "0.5",
549
- stroke: Ge.value,
550
- r: "3",
551
- fill: N.minimapLineColor
552
- }, null, 8, In),
553
- Re.value !== null ? (s(!0), r(b, { key: 0 }, C(qt.value, (S, X) => (s(), r("g", null, [
554
- Re.value === S && S >= ee.value && S < rt.value ? (s(), r("line", {
555
- key: 0,
556
- x1: ke.value * X + ke.value / 2,
557
- x2: ke.value * X + ke.value / 2,
558
- y1: 0,
559
- y2: Math.max(j.value.height, 0),
560
- stroke: N.minimapIndicatorColor,
561
- "stroke-linecap": "round",
562
- "stroke-dasharray": "2",
563
- "stroke-width": "1"
564
- }, null, 8, Nn)) : f("", !0)
565
- ]))), 256)) : f("", !0),
566
- (s(!0), r(b, null, C(qt.value, (S, X) => (s(), r("rect", {
567
- x: ke.value * X,
568
- y: 0,
569
- height: Math.max(j.value.height, 0),
570
- width: ke.value < 0 ? 0 : ke.value,
571
- fill: "transparent",
572
- style: _([{ "pointer-events": "all !important" }, { cursor: S >= ee.value && S < rt.value && N.enableSelectionDrag ? oe.value ? "grabbing" : "grab" : "default" }]),
573
- onMousedown: h[0] || (h[0] = (ce) => oe.value = !0),
574
- onMouseup: h[1] || (h[1] = (ce) => oe.value = !1),
575
- onMouseenter: (ce) => Cl(S),
576
- onMouseleave: h[2] || (h[2] = (ce) => {
577
- Re.value = null, xe("trapMouse", null);
578
- })
579
- }, null, 44, Rn))), 256))
580
- ], 8, kn))
581
- ])) : f("", !0),
582
- h[14] || (h[14] = y("div", { class: "slider-track" }, null, -1)),
583
- y("div", {
584
- class: Xe({
585
- "range-highlight": !0,
586
- move: N.enableSelectionDrag
587
- }),
588
- onMousedown: h[3] || (h[3] = (S) => oe.value = !0),
589
- onMouseup: h[4] || (h[4] = (S) => oe.value = !1),
590
- style: _({
591
- ...pe.value,
592
- cursor: oe.value ? "grabbing" : "grab"
593
- })
594
- }, null, 38),
595
- N.enableRangeHandles ? ia((s(), r("input", {
596
- ref_key: "rangeStart",
597
- ref: ue,
598
- key: `range-min${ft.value}`,
599
- type: "range",
600
- class: Xe({
601
- "range-left": !0,
602
- "range-handle": !0,
603
- "range-minimap": kt.value && N.verticalHandles
604
- }),
605
- min: N.min,
606
- max: N.max,
607
- "onUpdate:modelValue": h[5] || (h[5] = (S) => Ut.value = S),
608
- onInput: h[6] || (h[6] = (S) => ml(S)),
609
- onChange: je,
610
- onKeyup: Ya(je, ["enter"]),
611
- onBlur: je,
612
- onMouseenter: h[7] || (h[7] = (S) => kl("start")),
613
- onPointerup: je
614
- }, null, 42, Fn)), [
615
- [
616
- Ga,
617
- Ut.value,
618
- void 0,
619
- { number: !0 }
620
- ]
621
- ]) : f("", !0),
622
- N.enableRangeHandles ? ia((s(), r("input", {
623
- key: 2,
624
- ref_key: "rangeEnd",
625
- ref: Y,
626
- type: "range",
627
- class: Xe({
628
- "range-right": !0,
629
- "range-handle": !0,
630
- "range-minimap": kt.value && N.verticalHandles
631
- }),
632
- min: N.min,
633
- max: N.max,
634
- "onUpdate:modelValue": h[8] || (h[8] = (S) => wt.value = S),
635
- onInput: h[9] || (h[9] = (S) => Kt(S)),
636
- onChange: je,
637
- onKeyup: Ya(je, ["enter"]),
638
- onBlur: je,
639
- onMouseenter: h[10] || (h[10] = (S) => kl("end")),
640
- onPointerup: je
641
- }, null, 42, Pn)), [
642
- [
643
- Ga,
644
- wt.value,
645
- void 0,
646
- { number: !0 }
647
- ]
648
- ]) : f("", !0),
649
- ie.value.left ? (s(), r("div", {
650
- key: 3,
651
- ref_key: "tooltipLeft",
652
- ref: he,
653
- class: Xe({
654
- "range-tooltip": !0,
655
- "range-tooltip-visible": Se.value,
656
- "range-tooltip-arrow": pe.value.arrowLeft && !N.verticalHandles,
657
- "range-tooltip-arrow-left": !pe.value.arrowLeft && !N.verticalHandles
658
- }),
659
- style: _({
660
- left: pe.value.tooltipLeft,
661
- color: v(ut)(N.selectColor),
662
- backgroundColor: N.selectColor,
663
- border: `1px solid ${Ge.value}`,
664
- zIndex: `${qe.value + 4}`,
665
- visibility: $t.value || ie.value.left === ie.value.right ? "hidden" : "visible"
666
- })
667
- }, ne(ie.value.left), 7)) : f("", !0),
668
- ($t.value || ie.value.left === ie.value.right) && (ie.value.left || ie.value.right) ? (s(), r("div", {
669
- key: 4,
670
- ref: "tooltipMerge",
671
- class: Xe({
672
- "range-tooltip": !0,
673
- "range-tooltip-visible": Se.value,
674
- "range-tooltip-arrow": !0,
675
- "range-tooltip-arrow-left": !pe.value.arrowLeft && !N.verticalHandles,
676
- "range-tooltip-arrow-right": !pe.value.arrowRight && !N.verticalHandles
677
- }),
678
- style: _({
679
- left: pe.value.tooltipCenter,
680
- width: vt.value.width + "px",
681
- color: v(ut)(N.selectColor),
682
- backgroundColor: N.selectColor,
683
- border: `1px solid ${Ge.value}`,
684
- zIndex: "4"
685
- })
686
- }, ne(ie.value.left === ie.value.right ? ie.value.left : `${ie.value.left} - ${ie.value.right}`), 7)) : f("", !0),
687
- ie.value.right ? (s(), r("div", {
688
- key: 5,
689
- ref_key: "tooltipRight",
690
- ref: ct,
691
- class: Xe({
692
- "range-tooltip": !0,
693
- "range-tooltip-visible": Se.value,
694
- "range-tooltip-arrow": pe.value.arrowRight && !N.verticalHandles,
695
- "range-tooltip-arrow-right": !pe.value.arrowRight && !N.verticalHandles
696
- }),
697
- style: _({
698
- left: pe.value.tooltipRight,
699
- color: v(ut)(N.selectColor),
700
- backgroundColor: N.selectColor,
701
- border: `1px solid ${Ge.value}`,
702
- zIndex: "4",
703
- visibility: $t.value || ie.value.left === ie.value.right ? "hidden" : "visible"
704
- })
705
- }, ne(ie.value.right), 7)) : f("", !0)
706
- ], 544)
707
- ], 544));
708
- }
709
- }, Hn = /* @__PURE__ */ ao(Bn, [["__scopeId", "data-v-b9436af8"]]), Vn = ["id"], En = ["id"], Dn = ["viewBox", "aria-label"], Wn = ["x", "y", "width", "height"], Xn = { key: 1 }, Yn = { class: "vue-ui-xy-grid" }, Gn = ["stroke", "x1", "x2", "y1", "y2"], Un = ["stroke", "x1", "x2", "y1", "y2"], qn = { key: 1 }, Zn = ["x1", "x2", "y1", "y2", "stroke"], Kn = ["x1", "x2", "y1", "y2", "stroke"], Jn = ["x1", "x2", "y1", "y2", "stroke"], Qn = { key: 3 }, jn = ["d", "stroke"], eu = { key: 4 }, tu = ["d", "stroke"], lu = ["id"], au = ["stop-color"], ou = ["stop-color"], nu = ["stop-color"], uu = ["id"], iu = ["stop-color"], su = ["stop-color"], ru = ["stop-color"], cu = ["id"], vu = ["stop-color"], du = ["stop-color"], hu = ["id"], fu = ["stop-color"], mu = ["stop-color"], gu = ["id"], bu = ["stop-color"], xu = ["stop-color"], pu = ["x", "y", "height", "width", "fill"], yu = ["x", "y", "width"], ku = { key: 0 }, wu = ["x", "y", "height", "width", "fill"], Su = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], _u = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], $u = ["width", "x", "y"], Lu = { key: 0 }, Mu = ["id"], Cu = ["fill"], Au = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], zu = ["x", "y", "font-size", "fill"], Tu = ["stroke", "x1", "x2", "y1", "y2"], Iu = { key: 3 }, Nu = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ru = ["x", "y", "width", "height", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-dasharray"], Fu = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pu = ["fill", "font-size", "transform"], Ou = ["x1", "x2", "y1", "y2", "stroke"], Bu = ["x", "y", "font-size", "fill"], Hu = ["x1", "x2", "y1", "y2", "stroke"], Vu = ["x", "y", "font-size", "fill"], Eu = ["width", "x", "y"], Du = { style: { width: "100%" } }, Wu = { key: 0 }, Xu = ["id"], Yu = ["fill"], Gu = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], Uu = ["x", "y", "font-size", "fill"], qu = ["d", "stroke", "stroke-width", "stroke-dasharray"], Zu = ["d", "stroke", "stroke-width", "stroke-dasharray"], Ku = { key: 6 }, Ju = { key: 7 }, Qu = ["d", "fill", "fill-opacity"], ju = { key: 0 }, ei = ["d", "fill"], ti = ["d", "fill"], li = ["d", "fill"], ai = ["d", "fill"], oi = ["d", "stroke", "stroke-width", "stroke-dasharray"], ni = ["d", "stroke", "stroke-width", "stroke-dasharray"], ui = ["width", "x", "y"], ii = { style: { width: "100%" } }, si = { key: 3 }, ri = ["id"], ci = ["fill"], vi = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], di = ["x", "y", "font-size", "fill"], hi = { key: 8 }, fi = ["x", "y", "font-size", "fill"], mi = ["x", "y", "font-size", "fill", "font-weight"], gi = { key: 9 }, bi = ["x", "y", "font-size", "fill"], xi = { key: 10 }, pi = ["x", "y"], yi = ["innerHTML"], ki = ["x", "y"], wi = ["innerHTML"], Si = ["x1", "x2", "y1", "y2", "stroke"], _i = { key: 11 }, $i = ["x", "y", "font-size", "fill"], Li = { key: 12 }, Mi = ["x", "y"], Ci = ["innerHTML"], Ai = ["x", "y"], zi = ["innerHTML"], Ti = ["x1", "x2", "y1", "y2", "stroke"], Ii = ["x", "y", "font-size", "fill", "innerHTML"], Ni = ["x", "y", "font-size", "fill", "innerHTML"], Ri = ["x", "y", "font-size", "fill", "innerHTML"], Fi = ["x", "y", "font-size", "fill", "innerHTML"], Pi = ["id"], Oi = ["stop-color"], Bi = ["stop-color"], Hi = ["x", "y", "width", "height", "fill", "onMouseenter"], Vi = ["font-size", "fill", "transform"], Ei = ["x", "y", "font-size", "fill"], Di = ["text-anchor", "font-size", "fill", "transform", "onClick"], Wi = ["text-anchor", "font-size", "fill", "transform", "innerHTML", "onClick"], Xi = { key: 15 }, Yi = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"], Gi = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ui = ["y", "x", "width", "height", "fill"], qi = ["id", "x", "y", "font-size", "fill", "text-anchor"], Zi = {
710
- key: 16,
711
- style: { "pointer-events": "none" }
712
- }, Ki = ["x", "y"], Ji = ["innerHTML"], Qi = ["cx", "cy", "r", "fill"], ji = ["data-start", "data-end"], es = {
713
- key: 4,
714
- class: "vue-data-ui-watermark"
715
- }, ts = {
716
- class: "vue-ui-xy-tag-arrow",
717
- height: "20",
718
- viewBox: "0 0 10 20",
719
- style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
720
- }, ls = ["fill"], as = ["innerHTML"], os = {
721
- class: "vue-ui-xy-tag-arrow",
722
- height: "100%",
723
- viewBox: "0 0 10 20",
724
- style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
725
- }, ns = ["fill"], us = ["innerHTML"], is = {
726
- class: "vue-ui-xy-tag-arrow",
727
- height: "20",
728
- viewBox: "0 0 10 20",
729
- style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
730
- }, ss = ["fill"], rs = ["innerHTML"], cs = {
731
- class: "vue-ui-xy-tag-arrow",
732
- height: "100%",
733
- viewBox: "0 0 10 20",
734
- style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
735
- }, vs = ["fill"], ds = ["innerHTML"], hs = ["id"], fs = ["onClick"], ms = {
736
- key: 0,
737
- viewBox: "0 0 20 12",
738
- height: "1em",
739
- width: "1.43em"
740
- }, gs = ["stroke", "fill"], bs = {
741
- key: 1,
742
- viewBox: "0 0 40 40",
743
- height: "1em",
744
- width: "1em"
745
- }, xs = ["fill"], ps = ["fill"], ys = {
746
- key: 2,
747
- viewBox: "0 0 12 12",
748
- height: "1em",
749
- width: "1em"
750
- }, ks = {
751
- style: { display: "flex", "flex-direction": "row", gap: "6px", "align-items": "center", "padding-left": "6px" },
752
- "data-dom-to-png-ignore": ""
753
- }, ws = ["innerHTML"], Ss = {
754
- __name: "vue-ui-xy",
755
- props: {
756
- config: {
757
- type: Object,
758
- default() {
759
- return {};
760
- }
761
- },
762
- dataset: {
763
- type: Array,
764
- default() {
765
- return [];
766
- }
767
- },
768
- selectedXIndex: {
769
- type: Number,
770
- default: void 0
771
- }
772
- },
773
- emits: ["selectTimeLabel", "selectX", "selectLegend"],
774
- setup(N, { expose: Gl, emit: Ul }) {
775
- const d = N, Ye = Ct(() => import("./DataTable-Ddu14t59.js")), ve = Ct(() => import("./Tooltip-VlJQQsYu.js")), de = Ct(() => import("./UserOptions-sSygisu3.js")), kt = Ct(() => import("./BaseIcon-BCS8aIf4.js")), sl = Ct(() => import("./vue-ui-table-sparkline-Bt7VtPKK.js")), Gt = Ct(() => import("./PackageVersion-CtYY8jBZ.js")), rl = Ct(() => import("./PenAndPaper-DtlEAsLw.js")), Ut = Ct(() => import("./BaseDraggableDialog-Bdva4JFr.js")), wt = Ul, cl = Oo(), je = Bo(), { vue_ui_xy: vl } = Xo(), xe = g(null), pe = g(null), He = g(null), st = g(null), It = g(null), Nt = g(null), ql = g(null), Ge = g(null), qt = g(null), ht = g(null), Rt = g(null), j = g(null), Me = g(null), dl = g(null), St = g(0), P = g(null), hl = g(!0), ye = g(600), ee = g(1e3), rt = g("0 0 1000 600"), ke = g({ x: 0, y: 0 }), we = g({ line: "line", bar: "bar", plot: "plot" }), Ce = g(!1), Re = g(!1), Cl = g(!1), ft = g(null), ue = g([]), Y = g(Dl()), fl = g(0), Zt = g(0), ml = g(0), mt = g(!0), Kt = g(0), O = g(null), gt = g(!1), gl = g(!0), Jt = g(!0), Ae = g(null), et = g({}), Qt = g(null), bl = g(!1), bt = g(null), L = g(null), Al = x(() => ({
776
- height: ye.value,
777
- width: ee.value
778
- }));
779
- function tt(l) {
780
- return Number.isFinite(l) ? Math.max(0, Math.floor(l)) : 0;
781
- }
782
- function Ue(l, u, e = 0) {
783
- return Number.isFinite(l) && Number.isFinite(u) && Math.abs(u) > 1e-9 ? l / u : e;
784
- }
785
- const lt = g(!1), w = g({
786
- xAxis: 18,
787
- yAxis: 12,
788
- dataLabels: 20,
789
- plotLabels: 10
790
- }), Fe = g({ plot: 3, line: 3 });
791
- il(() => {
792
- bl.value = !0, d.dataset.length && d.dataset.forEach((l, u) => {
793
- [null, void 0].includes(l.series) && oa({
794
- componentName: "VueUiXy",
795
- type: "datasetSerieAttribute",
796
- property: "series (number[])",
797
- index: u,
798
- debug: _t.value
799
- });
800
- });
801
- });
802
- function xl() {
803
- if (!Object.keys(d.config || {}).length)
804
- return vl;
805
- const l = ua({
806
- userConfig: d.config,
807
- defaultConfig: vl
808
- });
809
- return d.config && We(d.config, "chart.highlightArea") && (Array.isArray(d.config.chart.highlightArea) ? l.chart.highlightArea = d.config.chart.highlightArea : l.chart.highlightArea = [d.config.chart.highlightArea]), d.config && We(d.config, "chart.grid.labels.yAxis.scaleMin") ? l.chart.grid.labels.yAxis.scaleMin = d.config.chart.grid.labels.yAxis.scaleMin : l.chart.grid.labels.yAxis.scaleMin = null, d.config && We(d.config, "chart.grid.labels.yAxis.scaleMax") ? l.chart.grid.labels.yAxis.scaleMax = d.config.chart.grid.labels.yAxis.scaleMax : l.chart.grid.labels.yAxis.scaleMax = null, d.config && We(d.config, "chart.zoom.startIndex") ? l.chart.zoom.startIndex = d.config.chart.zoom.startIndex : l.chart.zoom.startIndex = null, d.config && We(d.config, "chart.zoom.endIndex") ? l.chart.zoom.endIndex = d.config.chart.zoom.endIndex : l.chart.zoom.endIndex = null, d.config && We(d.config, "chart.grid.labels.yAxis.groupColor") ? l.chart.grid.labels.yAxis.groupColor = d.config.chart.grid.labels.yAxis.groupColor : l.chart.grid.labels.yAxis.groupColor = null, d.config && We(d.config, "chart.annotations") && Array.isArray(d.config.chart.annotations) && d.config.chart.annotations.length ? l.chart.annotations = d.config.chart.annotations.map((u) => ua({
810
- defaultConfig: vl.chart.annotations[0],
811
- userConfig: u
812
- })) : l.chart.annotations = [], d.config && We(d.config, "chart.grid.position") && d.config.chart.grid.position === "start" && d.dataset.length && d.dataset.some((u) => u.type === "bar") && (l.chart.grid.position = "middle", We(d.config, "debug") && console.warn("Vue Data UI - VueUiXy - config.chart.grid.position was overriden to `middle` because your dataset contains a bar")), d.config && We(d.config, "chart.grid.labels.yAxis.serieNameFormatter") ? l.chart.grid.labels.yAxis.serieNameFormatter = d.config.chart.grid.labels.yAxis.serieNameFormatter : l.chart.grid.labels.yAxis.serieNameFormatter = null, d.config && We(d.config, "events.datapointEnter") ? l.events.datapointEnter = d.config.events.datapointEnter : l.events.datapointEnter = null, d.config && We(d.config, "events.datapointLeave") ? l.events.datapointLeave = d.config.events.datapointLeave : l.events.datapointLeave = null, d.config && We(d.config, "events.datapointClick") ? l.events.datapointClick = d.config.events.datapointClick : l.events.datapointClick = null, l.theme ? {
813
- ...ua({
814
- userConfig: ln.vue_ui_xy[l.theme] || d.config,
815
- defaultConfig: l
816
- }),
817
- customPalette: tn[l.theme] || d.palette
818
- } : l;
819
- }
820
- const jt = x({
821
- get() {
822
- return !!d.dataset && d.dataset.length;
823
- },
824
- set(l) {
825
- return l;
826
- }
827
- }), t = g(xl()), k = g({
828
- dataLabels: { show: !0 },
829
- showTooltip: !0,
830
- showTable: !1,
831
- isStacked: !1,
832
- useIndividualScale: !1
833
- });
834
- function pl() {
835
- lt.value ? (k.value.isStacked = t.value.chart.grid.labels.yAxis.stacked, k.value.useIndividualScale == null && (k.value.useIndividualScale = t.value.chart.grid.labels.yAxis.useIndividualScale)) : (k.value = {
836
- dataLabels: { show: !0 },
837
- showTooltip: t.value.chart.tooltip.show === !0,
838
- showTable: t.value.showTable === !0,
839
- isStacked: t.value.chart.grid.labels.yAxis.stacked,
840
- useIndividualScale: t.value.chart.grid.labels.yAxis.useIndividualScale
841
- }, lt.value = !0);
842
- }
843
- const _t = x(() => !!t.value.debug), { loading: oe, FINAL_DATASET: he, manualLoading: ct } = sn({
844
- ...Ho(d),
845
- FINAL_CONFIG: t,
846
- prepareConfig: xl,
847
- callback: () => {
848
- Promise.resolve().then(async () => {
849
- await Tl(), k.value.showTable = t.value.showTable;
850
- });
851
- },
852
- skeletonDataset: [
853
- {
854
- name: "",
855
- series: [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 134],
856
- type: "line",
857
- smooth: !0,
858
- color: "#BABABA"
859
- },
860
- {
861
- name: "",
862
- series: [0, 0.5, 1, 1.5, 2.5, 4, 6.5, 10.5, 17, 27.5, 44.5, 67],
863
- type: "bar",
864
- color: "#CACACA"
865
- }
866
- ],
867
- skeletonConfig: Yo({
868
- defaultConfig: t.value,
869
- userConfig: {
870
- useCssAnimation: !1,
871
- showTable: !1,
872
- chart: {
873
- annotations: [],
874
- highlightArea: [],
875
- backgroundColor: "#99999930",
876
- grid: {
877
- stroke: "#6A6A6A",
878
- labels: {
879
- show: !1,
880
- axis: {
881
- yLabel: "",
882
- xLabel: ""
883
- },
884
- xAxisLabels: { show: !1 },
885
- yAxis: {
886
- commonScaleSteps: 10,
887
- useNiceScale: !0,
888
- scaleMin: 0,
889
- scaleMax: 134
890
- },
891
- zeroLine: { show: !0 }
892
- }
893
- },
894
- padding: {
895
- top: 12,
896
- bottom: 24,
897
- left: 24,
898
- right: 24
899
- },
900
- userOptions: { show: !1 },
901
- zoom: {
902
- show: !1,
903
- startIndex: null,
904
- endIndex: null
905
- }
906
- },
907
- bar: {
908
- serieName: { show: !1 },
909
- labels: { show: !1 },
910
- border: {
911
- useSerieColor: !1,
912
- stroke: "#999999"
913
- }
914
- },
915
- line: {
916
- dot: {
917
- useSerieColor: !1,
918
- fill: "#8A8A8A"
919
- },
920
- labels: { show: !1 }
921
- }
922
- }
923
- })
924
- });
925
- function yl(l) {
926
- const u = /* @__PURE__ */ new WeakMap();
927
- return (e, ...n) => {
928
- let a = u.get(e);
929
- const i = JSON.stringify(n);
930
- if (a && a.has(i)) return a.get(i);
931
- const o = l(e, ...n);
932
- return a || (a = /* @__PURE__ */ new Map(), u.set(e, a)), a.set(i, o), o;
933
- };
934
- }
935
- const el = yl((l, u) => na({ data: l, threshold: u })), Se = (l) => el(l, t.value.downsample.threshold), ze = x({
936
- get: () => Math.max(...he.value.map((l) => Se(l.series).length)),
937
- set: (l) => l
938
- }), p = g({ start: 0, end: ze.value }), qe = g({ start: 0, end: ze.value }), kl = x(() => t.value.chart.zoom.preview.enable && (qe.value.start !== p.value.start || qe.value.end !== p.value.end));
939
- function $t(l, u) {
940
- qe.value[l] = u;
941
- }
942
- function vt() {
943
- const l = Math.max(
944
- 1,
945
- ...he.value.map((n) => Se(n.series).length)
946
- );
947
- let u = Math.max(0, Math.min(p.value.start ?? 0, l - 1)), e = Math.max(u + 1, Math.min(p.value.end ?? l, l));
948
- (!Number.isFinite(u) || !Number.isFinite(e) || e <= u) && (u = 0, e = l), p.value = { start: u, end: e }, qe.value.start = u, qe.value.end = e;
949
- }
950
- const tl = x(() => {
951
- const { left: l, top: u, width: e, height: n } = c.value, a = p.value.start, o = p.value.end - a, z = e / o, B = qe.value.start - a, E = qe.value.end - a, $ = Math.max(0, Math.min(o, B)), I = Math.max(0, Math.min(o, E));
952
- return {
953
- x: l + $ * z,
954
- y: u,
955
- width: (I - $) * z,
956
- height: n,
957
- fill: t.value.chart.zoom.preview.fill,
958
- stroke: t.value.chart.zoom.preview.stroke,
959
- "stroke-width": t.value.chart.zoom.preview.strokeWidth,
960
- "stroke-dasharray": t.value.chart.zoom.preview.strokeDasharray,
961
- "stroke-linecap": "round",
962
- "stroke-linejoin": "round",
963
- style: {
964
- pointerEvents: "none",
965
- transition: "none !important",
966
- animation: "none !important"
967
- }
968
- };
969
- });
970
- it(() => d.selectedXIndex, (l) => {
971
- if ([null, void 0].includes(d.selectedXIndex)) {
972
- L.value = null;
973
- return;
974
- }
975
- const u = l - p.value.start;
976
- u < 0 || l >= p.value.end ? L.value = null : L.value = u ?? null;
977
- }, { immediate: !0 });
978
- const { isPrinting: ie, isImaging: m, generatePdf: h, generateImage: S } = un({
979
- elementId: `vue-ui-xy_${Y.value}`,
980
- fileName: t.value.chart.title.text || "vue-ui-xy",
981
- options: t.value.chart.userOptions.print
982
- }), X = g(!1), ce = x(() => Go(t.value.customPalette)), xt = x(() => {
983
- if (t.value.chart.grid.labels.yAxis.scaleMin !== null)
984
- return t.value.chart.grid.labels.yAxis.scaleMin;
985
- const l = Math.min(...at.value.filter((u) => !ue.value.includes(u.id)).map((u) => Math.min(...u.series)));
986
- return l > 0 ? 0 : l;
987
- }), ll = x(() => {
988
- if (t.value.chart.grid.labels.yAxis.scaleMax)
989
- return t.value.chart.grid.labels.yAxis.scaleMax;
990
- const l = Math.max(...at.value.filter((u) => !ue.value.includes(u.id)).map((u) => Math.max(...u.series)));
991
- return xt.value === l ? l + 1 : l;
992
- }), Te = x(() => t.value.chart.grid.labels.yAxis.useNiceScale ? Ml(xt.value, ll.value < 0 ? 0 : ll.value, t.value.chart.grid.labels.yAxis.commonScaleSteps) : Et(xt.value, ll.value < 0 ? 0 : ll.value, t.value.chart.grid.labels.yAxis.commonScaleSteps)), Ft = x(() => [null, void 0].includes(t.value.chart.grid.labels.yAxis.scaleMin) ? Te.value.min >= 0 ? 0 : Math.abs(Te.value.min) : -Te.value.min), at = x(() => hl.value ? he.value.map((l, u) => {
993
- const e = Se(l.series), n = `uniqueId_${u}`;
994
- return {
995
- ...l,
996
- slotAbsoluteIndex: u,
997
- series: e.map((a) => Hl(a) ? a : null).slice(p.value.start, p.value.end),
998
- color: Uo(l.color ? l.color : ce.value[u] ? ce.value[u] : qo[u]),
999
- id: n,
1000
- scaleLabel: l.scaleLabel || n
1001
- };
1002
- }) : he.value), Ze = x(() => at.value.map((l, u) => ({
1003
- absoluteIndex: u,
1004
- ...l,
1005
- series: l.series.map((e) => e + Ft.value),
1006
- absoluteValues: l.series,
1007
- segregate: () => _a(l),
1008
- isSegregated: ue.value.includes(l.id)
1009
- }))), Ke = x(() => at.value.map((l, u) => ({
1010
- ...l,
1011
- series: l.series.map((e) => e + Ft.value),
1012
- absoluteValues: l.series
1013
- })).filter((l) => !ue.value.includes(l.id)));
1014
- function oo() {
1015
- let l = 0;
1016
- Rt.value && (l = Array.from(Rt.value.querySelectorAll("text")).reduce((a, i) => {
1017
- const o = i.getComputedTextLength();
1018
- return (o > a ? o : a) + t.value.chart.grid.labels.yAxis.scaleValueOffsetX;
1019
- }, 0));
1020
- const u = qt.value ? qt.value.getBoundingClientRect().width + t.value.chart.grid.labels.axis.yLabelOffsetX + w.value.yAxis : 0, e = t.value.chart.grid.labels.yAxis.crosshairSize;
1021
- return l + u + e;
1022
- }
1023
- const Zl = g(0), no = sa((l) => {
1024
- Zl.value = l;
1025
- }, 100);
1026
- Ua((l) => {
1027
- const u = ht.value;
1028
- if (!u) return;
1029
- const e = new ResizeObserver((n) => {
1030
- no(n[0].contentRect.height);
1031
- });
1032
- e.observe(u), l(() => e.disconnect());
1033
- }), Xt(() => {
1034
- Zl.value = 0;
1035
- });
1036
- const ra = x(() => {
1037
- let l = 0;
1038
- Ge.value && (l = Ge.value.getBBox().height);
1039
- let u = 0;
1040
- return ht.value && (u = Zl.value), l + u + w.value.xAxis;
1041
- }), uo = x(() => he.value.some((l) => l.useProgression)), c = x(() => {
1042
- let l = 0;
1043
- const u = 36;
1044
- t.value.chart.grid.labels.show && (k.value.useIndividualScale && !k.value.isStacked ? l = (he.value.length - ue.value.length) * (t.value.chart.grid.labels.yAxis.labelWidth + u) : k.value.useIndividualScale && k.value.isStacked ? l = t.value.chart.grid.labels.yAxis.labelWidth + u : l = oo());
1045
- const e = t.value.chart.labels.fontSize * 1.1, n = uo.value ? 24 : 6;
1046
- if (ht.value) {
1047
- const o = ht.value.getBBox().x;
1048
- o < 0 && (l += Math.abs(o));
1049
- }
1050
- const a = ee.value - l - t.value.chart.grid.labels.yAxis.crosshairSize - n - t.value.chart.padding.left - t.value.chart.padding.right, i = t.value.chart.grid.position === "middle" ? 0 : a / T.value / 2;
1051
- return {
1052
- top: t.value.chart.padding.top + e,
1053
- right: ee.value - n - t.value.chart.padding.right,
1054
- bottom: ye.value - ra.value - t.value.chart.padding.bottom - t.value.chart.grid.labels.axis.xLabelOffsetY,
1055
- left: l + t.value.chart.grid.labels.yAxis.crosshairSize - i + t.value.chart.padding.left,
1056
- height: ye.value - ra.value - t.value.chart.padding.top - t.value.chart.padding.bottom - e - t.value.chart.grid.labels.axis.xLabelOffsetY,
1057
- width: a,
1058
- scaleLabelX: l,
1059
- individualOffsetX: u
1060
- };
1061
- }), io = x(() => {
1062
- const l = t.value.chart.grid.position === "middle" ? 1 : 0, u = T.value + l, e = Z(c.value.top), n = Z(c.value.bottom);
1063
- return Array.from({ length: u }).map((a, i) => {
1064
- const o = c.value.width / T.value * i + c.value.left + te.value;
1065
- return `M${o},${e} L${o},${n}`;
1066
- }).join(" ");
1067
- }), so = x(() => {
1068
- if (!t.value.chart.grid.labels.xAxis.showCrosshairs) return "";
1069
- const l = c.value.width / T.value, u = t.value.chart.grid.labels.xAxis.crosshairSize, e = t.value.chart.grid.labels.xAxis.crosshairsAlwaysAtZero;
1070
- return Jl.value.map((n, a) => {
1071
- if (!n || !n.text) return null;
1072
- const i = c.value.left + l * a + l / 2, o = e ? Ie.value - (Ie.value === c.value.bottom ? 0 : u / 2) : c.value.bottom, z = e ? Ie.value + u / (Ie.value === c.value.bottom ? 1 : 2) : c.value.bottom + u;
1073
- return `M${i},${o} L${i},${z}`;
1074
- }).filter(Boolean).join(" ");
1075
- });
1076
- function ca() {
1077
- return !!je?.vnode.props?.onSelectTimeLabel;
1078
- }
1079
- function ro(l, u, e) {
1080
- if (!Qt.value) {
1081
- const n = document.createElement("canvas");
1082
- Qt.value = n.getContext("2d");
1083
- }
1084
- return Qt.value.font = `normal ${l}px sans-serif`, Qt.value;
1085
- }
1086
- function va() {
1087
- const l = xe.value.querySelectorAll(".vue-ui-xy-tag");
1088
- l.length && Array.from(l).forEach((u) => u.style.opacity = "0");
1089
- }
1090
- function zl(l, u, e, n, a) {
1091
- e && (et.value[`${l}_${u}_${n}_${a}`] = e);
1092
- }
1093
- const da = g(!1);
1094
- async function ha(l = !1) {
1095
- await Yt(), da.value = l, gt.value && (Jt.value = l);
1096
- }
1097
- function Kl() {
1098
- Ce.value = !Ce.value;
1099
- }
1100
- const _e = x(() => {
1101
- const l = Math.max(...he.value.map((u) => na({ data: u.series, threshold: t.value.downsample.threshold }).length));
1102
- return lo({
1103
- values: t.value.chart.grid.labels.xAxisLabels.values,
1104
- maxDatapoints: l,
1105
- formatter: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter,
1106
- start: p.value.start,
1107
- end: p.value.end
1108
- });
1109
- }), fa = x(() => {
1110
- const l = Math.max(...he.value.map((u) => na({ data: u.series, threshold: t.value.downsample.threshold }).length));
1111
- return lo({
1112
- values: t.value.chart.grid.labels.xAxisLabels.values,
1113
- maxDatapoints: l,
1114
- formatter: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter,
1115
- start: 0,
1116
- end: ze.value
1117
- });
1118
- }), co = x(() => {
1119
- const l = t.value.chart.grid.labels.xAxisLabels.modulo;
1120
- return _e.value.length ? Math.min(l, [...new Set(_e.value.map((u) => u.text))].length) : l;
1121
- });
1122
- function vo(l) {
1123
- let u = null, e = null;
1124
- return (...n) => {
1125
- const a = JSON.stringify(n);
1126
- return a === u || (u = a, e = l(...n)), e;
1127
- };
1128
- }
1129
- const ho = vo((l, u, e, n, a, i, o, z) => {
1130
- if (l)
1131
- return n.length <= 2 ? n.map((F, ae) => ({ text: F, absoluteIndex: ae })) : n.map((F, ae) => ({ text: ae === 0 || ae === n.length - 1 || o != null && ae === o ? F : "", absoluteIndex: ae }));
1132
- if (!u)
1133
- return n.map((H, F) => ({ text: H, absoluteIndex: F }));
1134
- const B = Math.max(1, e || 1);
1135
- if (z <= B)
1136
- return n.map((H, F) => ({ text: H, absoluteIndex: F }));
1137
- const E = [];
1138
- for (let H = 0; H < n.length; H += 1) {
1139
- const F = n[H] ?? "";
1140
- if (!F) continue;
1141
- const ae = i + H - 1 >= 0 ? a[i + H - 1] ?? "" : null;
1142
- F !== ae && E.push(H);
1143
- }
1144
- if (!E.length)
1145
- return n.map((H, F) => ({ text: "", absoluteIndex: F }));
1146
- const $ = E.length, I = B, J = Math.max(2, Math.min(I - 3, $)), M = Math.min($, I + 3);
1147
- let D = Math.min(I, $), R = 1 / 0;
1148
- for (let H = J; H <= M; H += 1) {
1149
- const F = ($ - 1) % (H - 1), ae = Math.abs(H - I), Oe = F * 10 + ae;
1150
- Oe < R && (R = Oe, D = H);
1151
- }
1152
- const re = /* @__PURE__ */ new Set();
1153
- if (D <= 1)
1154
- re.add(E[Math.round(($ - 1) / 2)]);
1155
- else {
1156
- const H = ($ - 1) / (D - 1);
1157
- for (let F = 0; F < D; F += 1)
1158
- re.add(E[Math.round(F * H)]);
1159
- }
1160
- return n.map((H, F) => ({
1161
- text: re.has(F) ? H : "",
1162
- absoluteIndex: F
1163
- }));
1164
- }), Jl = x(() => {
1165
- const l = t.value.chart.grid.labels.xAxisLabels, u = _e.value || [], e = fa.value || [], n = p.value.start ?? 0, a = L.value, i = T.value, o = u.map((B) => B?.text ?? ""), z = e.map((B) => B?.text ?? "");
1166
- return ho(
1167
- !!l.showOnlyFirstAndLast,
1168
- !!l.showOnlyAtModulo,
1169
- Math.max(1, co.value || 1),
1170
- o,
1171
- z,
1172
- n,
1173
- a,
1174
- i
1175
- );
1176
- });
1177
- function ma(l, u) {
1178
- const e = Ke.value.map((n) => ({
1179
- shape: n.shape || null,
1180
- name: n.name,
1181
- color: n.color,
1182
- type: n.type,
1183
- value: n.absoluteValues.find((a, i) => i === u),
1184
- comments: n.comments || [],
1185
- prefix: n.prefix || t.value.chart.labels.prefix,
1186
- suffix: n.suffix || t.value.chart.labels.suffix
1187
- }));
1188
- wt("selectTimeLabel", {
1189
- datapoint: e,
1190
- absoluteIndex: l.absoluteIndex,
1191
- label: l.text
1192
- });
1193
- }
1194
- const T = x(() => {
1195
- const l = tt((p.value.end ?? 0) - (p.value.start ?? 0));
1196
- return Math.max(1, l);
1197
- });
1198
- function ga(l) {
1199
- O.value = l;
1200
- }
1201
- function ba() {
1202
- k.value.isStacked = !k.value.isStacked, k.value.isStacked ? k.value.useIndividualScale = !0 : k.value.useIndividualScale = t.value.chart.grid.labels.yAxis.useIndividualScale;
1203
- }
1204
- function Ql(l) {
1205
- _t.value && l.autoScaling && (t.value.chart.grid.labels.yAxis.useIndividualScale || console.warn(`VueUiXy (datapoint: ${l.name}) : autoScaling only works when config.chart.grid.labels.yAxis.useIndividualScale is set to true`), t.value.chart.grid.labels.yAxis.stacked || console.warn(`VueUiXy (datapoint: ${l.name}) : autoScaling only works when config.chart.grid.labels.yAxis.stacked is set to true`));
1206
- }
1207
- function fo(l, u) {
1208
- const e = tt(l), n = Array(e).fill(0);
1209
- for (let a = 0; a < u.length && a < e; a += 1) n[a] = u[a] ?? 0;
1210
- return n;
1211
- }
1212
- function mo(l) {
1213
- const u = Math.max(...he.value.map((e) => Se(e.series).length));
1214
- return l > u ? u : l < 0 || t.value.chart.zoom.startIndex !== null && l < t.value.chart.zoom.startIndex ? t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex + 1 : 1 : l;
1215
- }
1216
- async function Tl() {
1217
- await Yt(), await Yt();
1218
- const { startIndex: l, endIndex: u } = t.value.chart.zoom, e = He.value, n = Math.max(...he.value.map((a) => Se(a.series).length));
1219
- p.value = { start: 0, end: n }, (l != null || u != null) && e ? (l != null ? (p.value.start = l, e.setStartValue(l)) : (p.value.start = 0, e.setStartValue(0)), u != null ? (p.value.end = u + 1, e.setEndValue(mo(u + 1))) : (p.value.end = n, e.setEndValue(n))) : (p.value = { start: 0, end: n }, St.value += 1), qe.value.start = p.value.start, qe.value.end = p.value.end, vt();
1220
- }
1221
- async function xa() {
1222
- await Tl();
1223
- }
1224
- function Ve(l) {
1225
- return ![null, void 0, NaN, 1 / 0, -1 / 0].includes(l);
1226
- }
1227
- const pa = x(() => Te.value.max + Ft.value);
1228
- function Pt(l) {
1229
- return l / (Ve(pa.value) ? pa.value : 1);
1230
- }
1231
- const Ie = x(() => isNaN(Pt(Ft.value)) ? c.value.bottom : c.value.bottom - c.value.height * Pt(Ft.value));
1232
- function ya(l) {
1233
- const u = ![null, void 0].includes(t.value.chart.grid.labels.yAxis.scaleMin) && t.value.chart.grid.labels.yAxis.scaleMin > 0 && xt.value >= 0 ? c.value.bottom : Ie.value;
1234
- return l.value >= 0 ? W(u - l.y <= 0 ? 1e-5 : u - l.y) : W(l.y - Ie.value <= 0 ? 1e-5 : l.y - Ie.value);
1235
- }
1236
- function ka(l) {
1237
- return l.value >= 0 ? W(l.zeroPosition - l.y <= 0 ? 1e-5 : l.zeroPosition - l.y) : W(l.y - l.zeroPosition <= 0 ? 1e-5 : l.zeroPosition - l.y);
1238
- }
1239
- const se = x(() => {
1240
- const l = Math.max(1, T.value), u = Math.max(1, c.value.width), e = Math.max(1, at.value.filter((n) => n.type === "bar" && !ue.value.includes(n.id)).length);
1241
- return {
1242
- bar: Ue(u, l * e, 1),
1243
- plot: Ue(u, l, 1),
1244
- line: Ue(u, l, 1)
1245
- };
1246
- });
1247
- function al() {
1248
- return k.value.useIndividualScale && k.value.isStacked ? se.value.line - c.value.width / T.value * 0.1 : se.value.bar;
1249
- }
1250
- function Il(l) {
1251
- return k.value.useIndividualScale && k.value.isStacked ? l.x + c.value.width / T.value * 0.05 : l.x + se.value.bar / 2;
1252
- }
1253
- function wa(l) {
1254
- return l.value >= 0 ? l.y : [null, void 0, NaN, 1 / 0, -1 / 0].includes(Ie.value) ? c.bottom.value : Ie.value;
1255
- }
1256
- function Sa(l) {
1257
- return l.value >= 0 ? l.y : [null, void 0, NaN, 1 / 0, -1 / 0].includes(l.zeroPosition) ? 0 : l.zeroPosition;
1258
- }
1259
- const wl = g(null);
1260
- let Ot = 0;
1261
- function go(l, u, e) {
1262
- return l >= e.left && l <= e.right && u >= e.top && u <= e.bottom;
1263
- }
1264
- function bo(l) {
1265
- if (Ce.value) return;
1266
- Ot && cancelAnimationFrame(Ot);
1267
- const u = Ae.value?.getBoundingClientRect();
1268
- Ot = requestAnimationFrame(() => {
1269
- if (Ot = 0, !u || !go(l.clientX, l.clientY, u)) {
1270
- jl();
1271
- return;
1272
- }
1273
- const n = Ae.value.viewBox.baseVal.width / u.width, i = (l.clientX - u.left) * n - c.value.left, o = c.value.width / T.value, z = Math.floor(i / o);
1274
- z >= 0 && z < T.value ? wl.value !== z && (wl.value = z, Ra(!0, z)) : jl();
1275
- });
1276
- }
1277
- function jl() {
1278
- Ot && (cancelAnimationFrame(Ot), Ot = 0), wl.value = null, Ra(!1, null);
1279
- }
1280
- function xo() {
1281
- wl.value != null && po(wl.value);
1282
- }
1283
- function po(l) {
1284
- const u = Ke.value.map((e) => ({
1285
- name: e.name,
1286
- value: [null, void 0, NaN].includes(e.absoluteValues[l]) ? null : e.absoluteValues[l],
1287
- color: e.color,
1288
- type: e.type
1289
- }));
1290
- wt(
1291
- "selectX",
1292
- {
1293
- dataset: u,
1294
- index: l,
1295
- indexLabel: t.value.chart.grid.labels.xAxisLabels.values[l]
1296
- }
1297
- ), t.value.events.datapointClick && t.value.events.datapointClick({ datapoint: u, seriesIndex: l + p.value.start });
1298
- }
1299
- function yo() {
1300
- return Ze.value.map((l) => ({
1301
- values: l.absoluteValues,
1302
- color: l.color,
1303
- name: l.name,
1304
- type: l.type
1305
- }));
1306
- }
1307
- async function ko({ scale: l = 2 } = {}) {
1308
- if (!xe.value) return;
1309
- const { width: u, height: e } = xe.value.getBoundingClientRect(), n = u / e, { imageUri: a, base64: i } = await hn({ domElement: xe.value, base64: !0, img: !0, scale: l });
1310
- return {
1311
- imageUri: a,
1312
- base64: i,
1313
- title: t.value.chart.title.text,
1314
- width: u,
1315
- height: e,
1316
- aspectRatio: n
1317
- };
1318
- }
1319
- function _a(l) {
1320
- if (ue.value.includes(l.id))
1321
- ue.value = ue.value.filter((u) => u !== l.id);
1322
- else {
1323
- if (ue.value.length + 1 === at.value.length) return;
1324
- ue.value.push(l.id);
1325
- }
1326
- wt("selectLegend", Ke.value.map((u) => ({
1327
- name: u.name,
1328
- values: u.absoluteValues,
1329
- color: u.color,
1330
- type: u.type
1331
- }))), Kt.value += 1;
1332
- }
1333
- const wo = x(() => {
1334
- const l = t.value.chart.title.text || "Chart visualization", u = t.value.chart.title.subtitle.text || "";
1335
- return `${l}. ${u}`;
1336
- }), $a = x(() => ({
1337
- linePlot: T.value > t.value.line.dot.hideAboveMaxSerieLength
1338
- })), So = x(() => t.value.chart.userOptions.show && (!t.value.chart.title.show || !t.value.chart.title.text)), _o = x(() => {
1339
- if (Array.isArray(t.value.chart.highlightArea))
1340
- return t.value.chart.highlightArea.map((u) => {
1341
- const e = Math.min(u.to, ze.value - 1);
1342
- return {
1343
- ...u,
1344
- span: u.from === e ? 1 : e < u.from ? 0 : e - u.from + 1
1345
- };
1346
- });
1347
- const l = {
1348
- ...t.value.chart.highlightArea,
1349
- to: Math.min(t.value.chart.highlightArea.to, ze.value - 1)
1350
- };
1351
- return [{ ...l, span: l.from === l.to ? 1 : l.to < l.from ? 0 : l.to - l.from + 1 }];
1352
- }), $o = x(() => hl.value ? he.value.map((l, u) => ({
1353
- ...l,
1354
- series: Se(l.series),
1355
- id: `uniqueId_${u}`
1356
- })) : he.value), Lo = x(() => Ke.value.map((l) => {
1357
- const u = l.absoluteValues.map((e) => [void 0, null].includes(e) ? 0 : e);
1358
- return {
1359
- id: l.id,
1360
- name: l.name,
1361
- color: l.color,
1362
- values: fo(T.value, u)
1363
- };
1364
- })), Mo = x(() => ({
1365
- responsiveBreakpoint: t.value.table.responsiveBreakpoint,
1366
- roundingValues: t.value.table.rounding,
1367
- showAverage: !1,
1368
- showMedian: !1,
1369
- showTotal: !1,
1370
- fontFamily: t.value.chart.fontFamily,
1371
- prefix: t.value.chart.labels.prefix,
1372
- suffix: t.value.chart.labels.suffix,
1373
- colNames: _e.value.map((l, u) => t.value.table.useDefaultTimeFormat ? l.text : ol.value(u + p.value.start, t.value.table.timeFormat)),
1374
- thead: {
1375
- backgroundColor: t.value.table.th.backgroundColor,
1376
- color: t.value.table.th.color,
1377
- outline: t.value.table.th.outline
1378
- },
1379
- tbody: {
1380
- backgroundColor: t.value.table.td.backgroundColor,
1381
- color: t.value.table.td.color,
1382
- outline: t.value.table.td.outline
1383
- },
1384
- userOptions: {
1385
- show: !1
1386
- },
1387
- sparkline: {
1388
- animation: { show: !1 }
1389
- }
1390
- })), te = x(() => t.value.chart.grid.position === "middle" ? 0 : c.value.width / T.value / 2), Bt = x(() => Zo(Ze.value.filter((l) => !ue.value.includes(l.id)))), A = x(() => {
1391
- const l = Object.groupBy(Bt.value, (e) => e.scaleLabel), u = {};
1392
- for (const [e, n] of Object.entries(l)) {
1393
- const a = n.flatMap((i) => i.absoluteValues);
1394
- u[e] = {
1395
- min: Math.min(...a) || 0,
1396
- max: Math.max(...a) || 1,
1397
- groupId: `scale_group_${Dl()}`
1398
- };
1399
- }
1400
- return u;
1401
- }), Co = x(() => {
1402
- const l = at.value.filter((u) => u.type === "bar").filter((u) => !ue.value.includes(u.id)).length;
1403
- return c.value.width / T.value / l - Nl.value * l;
1404
- }), Nl = x(() => se.value.line * t.value.bar.periodGap), Rl = x(() => Math.max(1e-5, al() - (k.value.useIndividualScale && k.value.isStacked ? 0 : Nl.value))), Fl = x(() => Rl.value * Math.min(Math.abs(t.value.bar.innerGap), 0.95)), La = x(() => {
1405
- if (!t.value.chart.zoom.minimap.show) return [];
1406
- const l = $o.value.filter((a) => !ue.value.includes(a.id)), u = Math.max(...l.map((a) => a.series.length)), e = [];
1407
- for (let a = 0; a < u; a += 1)
1408
- e.push(l.map((i) => i.series[a] || 0).reduce((i, o) => (i || 0) + (o || 0), 0));
1409
- const n = Math.min(...e);
1410
- return e.map((a) => a + (n < 0 ? Math.abs(n) : 0));
1411
- }), pt = x(() => Ke.value.map((l) => ({
1412
- slotAbsoluteIndex: l.slotAbsoluteIndex,
1413
- shape: l.shape || null,
1414
- name: l.name,
1415
- color: l.color,
1416
- type: l.type,
1417
- value: l.absoluteValues.find((u, e) => e === L.value),
1418
- comments: l.comments || [],
1419
- prefix: l.prefix || t.value.chart.labels.prefix,
1420
- suffix: l.suffix || t.value.chart.labels.suffix
1421
- }))), Ma = x(() => Te.value.ticks.map((l) => ({
1422
- y: l >= 0 ? Ie.value - c.value.height * Pt(l) : Ie.value + c.value.height * Pt(Math.abs(l)),
1423
- value: l,
1424
- prefix: t.value.chart.labels.prefix,
1425
- suffix: t.value.chart.labels.suffix
1426
- }))), Ca = x(() => {
1427
- const l = t.value.chart.annotations;
1428
- if (!l || !Array.isArray(l) || l.every(($) => !$.show)) return [];
1429
- const u = l.filter(
1430
- ($) => $.show && ($.yAxis.yTop != null || $.yAxis.yBottom != null)
1431
- );
1432
- if (!u.length) return [];
1433
- const { left: e, right: n } = c.value, a = Ie.value, i = c.value.height, o = Te.value.min, B = Te.value.max - o, E = ($) => {
1434
- const I = ($ - 0) / B;
1435
- return a - I * i;
1436
- };
1437
- return u.map(($) => {
1438
- const { yAxis: { yTop: I, yBottom: J, label: M } } = $, D = I != null && J != null && I !== J, R = I == null ? null : E(I), re = J == null ? null : E(J), H = ro(M.fontSize);
1439
- H.font = `${M.fontSize}px sans-serif`;
1440
- const F = H.measureText(M.text).width, ae = M.fontSize, Oe = (M.position === "start" ? e + M.padding.left : n - M.padding.right) + M.offsetX, Ee = (R != null && re != null ? Math.min(R, re) : R ?? re) - M.fontSize / 3 + M.offsetY - M.padding.top;
1441
- let U;
1442
- M.textAnchor === "middle" ? U = Oe - F / 2 - M.padding.left : M.textAnchor === "end" ? U = Oe - F - M.padding.right : U = Oe - M.padding.left;
1443
- const q = Ee - ae * 0.75 - M.padding.top;
1444
- return {
1445
- show: ![R, re, q].includes(NaN),
1446
- id: `annotation_y_${Dl()}`,
1447
- hasArea: D,
1448
- areaHeight: D ? Math.abs(R - re) : 0,
1449
- yTop: R,
1450
- yBottom: re,
1451
- config: $.yAxis,
1452
- x1: e,
1453
- x2: n,
1454
- _text: { x: Oe, y: Ee },
1455
- _box: {
1456
- x: U,
1457
- y: q,
1458
- width: F + M.padding.left + M.padding.right,
1459
- height: ae + M.padding.top + M.padding.bottom,
1460
- fill: M.backgroundColor,
1461
- stroke: M.border.stroke,
1462
- rx: M.border.rx,
1463
- ry: M.border.ry,
1464
- strokeWidth: M.border.strokeWidth
1465
- }
1466
- };
1467
- });
1468
- });
1469
- function Aa(l, u) {
1470
- const e = l[u - 1], n = l[u + 1];
1471
- let a = !!e && !!n && e.value == null && n.value == null || !e && !!n && n.value == null || !!e && !n && e.value == null;
1472
- return Ve(l[u].value) && a && t.value.line.cutNullValues;
1473
- }
1474
- const yt = x(() => {
1475
- const l = Bt.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), u = l.length, e = t.value.chart.grid.labels.yAxis.gap, n = k.value.isStacked, a = n ? e * (u - 1) : 0, i = c.value.height - a;
1476
- return l.filter((o) => o.type === "bar").map((o, z) => {
1477
- Ql(o);
1478
- const B = A.value[o.scaleLabel].min, E = A.value[o.scaleLabel].max;
1479
- o.absoluteValues.filter((G) => ![null, void 0].includes(G)).map((G) => (G - B) / (E - B));
1480
- const $ = {
1481
- valueMin: B,
1482
- valueMax: E < 0 ? 0 : E
1483
- }, I = {
1484
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1485
- min: o.scaleMin || Math.min(...o.absoluteValues.filter((G) => ![void 0, null].includes(G))) > 0 ? 0 : Math.min(...o.absoluteValues.filter((G) => ![null, void 0].includes(G)))
1486
- }, J = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, M = 1.0000001, D = t.value.chart.grid.labels.yAxis.useNiceScale ? Ml(I.min, I.max === I.min ? I.max * M : I.max, J) : Et(I.min, I.max === I.min ? I.max * M : I.max, J), R = t.value.chart.grid.labels.yAxis.useNiceScale ? Ml($.valueMin, $.valueMax === $.valueMin ? $.valueMax * M : $.valueMax, J) : Et($.valueMin, $.valueMax === $.valueMin ? $.valueMax * M : $.valueMax, J), re = D.min >= 0 ? 0 : Math.abs(D.min), H = 0, F = D.max + re, ae = R.max + Math.abs(H), Oe = o.stackIndex, nl = u - 1 - Oe, Ee = n ? 1 - o.cumulatedStackRatio : 0, U = n ? i * Ee + e * nl : 0, q = n ? i * o.stackRatio : c.value.height, fe = c.value.bottom - U - q * re / F, De = c.value.bottom - U - q * H / ae, Ne = Ze.value.filter((G) => G.type === "bar").filter((G) => !ue.value.includes(G.id)).length, $l = o.series.map((G, ge) => {
1487
- const Mt = k.value.useIndividualScale ? (o.absoluteValues[ge] + re) / F : Pt(G), Ht = k.value.useIndividualScale && k.value.isStacked ? c.value.left + c.value.width / T.value * ge : c.value.left + se.value.bar * z + se.value.bar * ge * Ne - Co.value / 2 - z * Nl.value;
1488
- return {
1489
- yOffset: W(U),
1490
- individualHeight: W(q),
1491
- x: W(Ht),
1492
- y: c.value.bottom - U - q * Mt,
1493
- value: o.absoluteValues[ge],
1494
- zeroPosition: W(fe),
1495
- individualMax: W(F),
1496
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ge] || ""
1497
- };
1498
- }), Be = o.absoluteValues.map((G) => R.min >= 0 ? (G - Math.abs(R.min)) / (R.max - Math.abs(R.min)) : (G + Math.abs(R.min)) / (R.max + Math.abs(R.min))), Lt = o.series.map((G, ge) => {
1499
- const Mt = k.value.useIndividualScale && k.value.isStacked ? c.value.left + c.value.width / T.value * ge : c.value.left - se.value.bar / 2 + se.value.bar * z + se.value.bar * ge * Ze.value.filter((Ht) => Ht.type === "bar").filter((Ht) => !ue.value.includes(Ht.id)).length;
1500
- return {
1501
- yOffset: W(U),
1502
- individualHeight: W(q),
1503
- x: W(Mt),
1504
- y: W(c.value.bottom - W(U) - (W(q) * Be[ge] || 0)),
1505
- value: o.absoluteValues[ge],
1506
- zeroPosition: W(fe),
1507
- individualMax: W(F),
1508
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[ge] || ""
1509
- };
1510
- }), Q = D.ticks.map((G) => ({
1511
- y: G >= 0 ? fe - q * (G / F) : fe + q * Math.abs(G) / F,
1512
- value: G,
1513
- prefix: o.prefix || t.value.chart.labels.prefix,
1514
- suffix: o.suffix || t.value.chart.labels.suffix,
1515
- datapoint: o
1516
- })), me = R.ticks.map((G) => {
1517
- const ge = (G - R.min) / (R.max - R.min);
1518
- return {
1519
- y: G >= 0 ? De - q * ge : De + q * ge,
1520
- value: G,
1521
- prefix: o.prefix || t.value.chart.labels.prefix,
1522
- suffix: o.suffix || t.value.chart.labels.suffix,
1523
- datapoint: o
1524
- };
1525
- });
1526
- return A.value[o.scaleLabel].name = o.name, A.value[o.scaleLabel].groupName = o.scaleLabel, A.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, A.value[o.scaleLabel].color = o.color, A.value[o.scaleLabel].scaleYLabels = o.autoScaling ? me : Q, A.value[o.scaleLabel].zeroPosition = o.autoScaling ? De : fe, A.value[o.scaleLabel].individualMax = o.autoScaling ? ae : F, A.value[o.scaleLabel].scaleLabel = o.scaleLabel, A.value[o.scaleLabel].id = o.id, A.value[o.scaleLabel].yOffset = U, A.value[o.scaleLabel].individualHeight = q, A.value[o.scaleLabel].autoScaleYLabels = me, A.value[o.scaleLabel].unique = Bt.value.filter((G) => G.scaleLabel === o.scaleLabel).length === 1, {
1527
- ...o,
1528
- yOffset: U,
1529
- autoScaleYLabels: me,
1530
- individualHeight: q,
1531
- scaleYLabels: o.autoScaling ? me : Q,
1532
- individualScale: o.autoScaling ? R : D,
1533
- individualMax: o.autoScaling ? ae : F,
1534
- zeroPosition: o.autoScaling ? De : fe,
1535
- plots: o.autoScaling ? Lt : $l,
1536
- groupId: A.value[o.scaleLabel].groupId
1537
- };
1538
- });
1539
- }), Pe = x(() => {
1540
- const l = Bt.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), u = l.length, e = t.value.chart.grid.labels.yAxis.gap, n = k.value.isStacked, a = n ? e * (u - 1) : 0, i = c.value.height - a;
1541
- return l.filter((o) => o.type === "line").map((o, z) => {
1542
- Ql(o);
1543
- const B = A.value[o.scaleLabel].min, E = A.value[o.scaleLabel].max;
1544
- o.absoluteValues.filter((V) => ![null, void 0].includes(V)).map((V) => (V - B) / (E - B));
1545
- const $ = {
1546
- valueMin: B,
1547
- valueMax: E
1548
- }, I = {
1549
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1550
- min: o.scaleMin || (Math.min(...o.absoluteValues) > 0 ? 0 : Math.min(...o.absoluteValues))
1551
- }, J = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, M = 1.0000001, D = t.value.chart.grid.labels.yAxis.useNiceScale ? Ml(I.min, I.max === I.min ? I.max * M : I.max, J) : Et(I.min, I.max === I.min ? I.max * M : I.max, J), R = t.value.chart.grid.labels.yAxis.useNiceScale ? Ml($.valueMin, $.valueMax === $.valueMin ? $.valueMax * M : $.valueMax, J) : Et($.valueMin, $.valueMax === $.valueMin ? $.valueMax * M : $.valueMax, J), re = D.min >= 0 ? 0 : Math.abs(D.min), H = 0, F = D.max + Math.abs(re), ae = R.max + Math.abs(H), Oe = o.stackIndex, nl = u - 1 - Oe, Ee = n ? 1 - o.cumulatedStackRatio : 0, U = n ? i * Ee + e * nl : 0, q = n ? i * o.stackRatio : c.value.height, fe = c.value.bottom - U - q * re / F, De = c.value.bottom - U - q * H / ae, Ne = o.series.map((V, $e) => {
1552
- const Ro = k.value.useIndividualScale ? (o.absoluteValues[$e] + Math.abs(re)) / F : Pt(V);
1553
- return {
1554
- x: W(c.value.left + se.value.line / 2 + se.value.line * $e),
1555
- y: W(c.value.bottom - U - q * Ro),
1556
- value: o.absoluteValues[$e],
1557
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[$e] || ""
1558
- };
1559
- }), $l = o.absoluteValues.map((V) => R.min >= 0 ? (V - Math.abs(R.min)) / (R.max - Math.abs(R.min)) : (V + Math.abs(R.min)) / (R.max + Math.abs(R.min))), Be = o.series.map((V, $e) => [void 0, null].includes(o.absoluteValues[$e]) ? {
1560
- x: W(c.value.left + se.value.line / 2 + se.value.line * $e),
1561
- y: fe,
1562
- value: o.absoluteValues[$e],
1563
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[$e] || ""
1564
- } : {
1565
- x: W(c.value.left + se.value.line / 2 + se.value.line * $e),
1566
- y: W(c.value.bottom - U - (q * $l[$e] || 0)),
1567
- value: o.absoluteValues[$e],
1568
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[$e] || ""
1569
- }), Lt = t.value.line.cutNullValues ? Ka(Ne) : Xl(Ne.filter((V) => V.value !== null)), Q = t.value.line.cutNullValues ? Ka(Be) : Xl(Be.filter((V) => V.value !== null)), me = t.value.line.cutNullValues ? Ja(Ne) : Yl(Ne.filter((V) => V.value !== null)), G = t.value.line.cutNullValues ? Ja(Be) : Yl(Be.filter((V) => V.value !== null)), ge = D.ticks.map((V) => ({
1570
- y: V >= 0 ? fe - q * (V / F) : fe + q * Math.abs(V) / F,
1571
- value: V,
1572
- prefix: o.prefix || t.value.chart.labels.prefix,
1573
- suffix: o.suffix || t.value.chart.labels.suffix,
1574
- datapoint: o
1575
- })), Mt = R.ticks.map((V) => {
1576
- const $e = (V - R.min) / (R.max - R.min);
1577
- return {
1578
- y: V >= 0 ? De - q * $e : De + q * $e,
1579
- value: V,
1580
- prefix: o.prefix || t.value.chart.labels.prefix,
1581
- suffix: o.suffix || t.value.chart.labels.suffix,
1582
- datapoint: o
1583
- };
1584
- });
1585
- A.value[o.scaleLabel].name = o.name, A.value[o.scaleLabel].groupName = o.scaleLabel, A.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, A.value[o.scaleLabel].color = o.color, A.value[o.scaleLabel].scaleYLabels = o.autoScaling ? Mt : ge, A.value[o.scaleLabel].zeroPosition = o.autoScaling ? De : fe, A.value[o.scaleLabel].individualMax = o.autoScaling ? ae : F, A.value[o.scaleLabel].scaleLabel = o.scaleLabel, A.value[o.scaleLabel].id = o.id, A.value[o.scaleLabel].yOffset = U, A.value[o.scaleLabel].individualHeight = q, A.value[o.scaleLabel].autoScaleYLabels = Mt, A.value[o.scaleLabel].unique = Bt.value.filter((V) => V.scaleLabel === o.scaleLabel).length === 1;
1586
- const Ht = k.value.useIndividualScale ? o.autoScaling ? De : fe : Ie.value, Ll = Math.max(Math.max(o.autoScaling ? De : ge.at(-1) ? ge.at(-1).y : 0, c.value.top), Ht);
1587
- return {
1588
- ...o,
1589
- yOffset: U,
1590
- autoScaleYLabels: Mt,
1591
- individualHeight: q,
1592
- scaleYLabels: o.autoScaling ? Mt : ge,
1593
- individualScale: o.autoScaling ? R : D,
1594
- individualMax: o.autoScaling ? ae : F,
1595
- zeroPosition: o.autoScaling ? De : fe,
1596
- curve: o.autoScaling ? Q : Lt,
1597
- plots: o.autoScaling ? Be : Ne,
1598
- area: o.useArea ? k.value.useIndividualScale ? t.value.line.cutNullValues ? Qa(
1599
- o.autoScaling ? Be : Ne,
1600
- Ll
1601
- ) : ja(
1602
- o.autoScaling ? Be.filter((V) => V.value !== null) : Ne.filter((V) => V.value !== null),
1603
- Ll
1604
- ) : t.value.line.cutNullValues ? Qa(Ne, Ll) : ja(Ne.filter((V) => V.value !== null), Ll) : "",
1605
- curveAreas: o.useArea ? Ko(
1606
- o.autoScaling ? t.value.line.cutNullValues ? Be : Be.filter((V) => V.value !== null) : t.value.line.cutNullValues ? Ne : Ne.filter((V) => V.value !== null),
1607
- Ll,
1608
- t.value.line.cutNullValues
1609
- ) : [],
1610
- straight: o.autoScaling ? G : me,
1611
- groupId: A.value[o.scaleLabel].groupId
1612
- };
1613
- });
1614
- }), ot = x(() => {
1615
- const l = Bt.value.filter((o) => ["bar", "line", "plot"].includes(o.type)), u = l.length, e = t.value.chart.grid.labels.yAxis.gap, n = k.value.isStacked, a = n ? e * (u - 1) : 0, i = c.value.height - a;
1616
- return l.filter((o) => o.type === "plot").map((o) => {
1617
- Ql(o);
1618
- const z = A.value[o.scaleLabel].min, B = A.value[o.scaleLabel].max;
1619
- o.absoluteValues.filter((Q) => ![null, void 0].includes(Q)).map((Q) => (Q - z) / (B - z));
1620
- const E = {
1621
- valueMin: z,
1622
- valueMax: B
1623
- }, $ = {
1624
- max: o.scaleMax || Math.max(...o.absoluteValues) || 1,
1625
- min: o.scaleMin || Math.min(...o.absoluteValues) > 0 ? 0 : Math.min(...o.absoluteValues)
1626
- }, I = o.scaleSteps || t.value.chart.grid.labels.yAxis.commonScaleSteps, J = 1.0000001, M = Et($.min, $.max === $.min ? $.max * J : $.max, I), D = Et(E.valueMin, E.valueMax === E.valueMin ? E.valueMax * J : E.valueMax, I), R = M.min >= 0 ? 0 : Math.abs(M.min), re = 0, H = M.max + R, F = D.max + Math.abs(re), ae = o.stackIndex, Oe = u - 1 - ae, nl = n ? 1 - o.cumulatedStackRatio : 0, Ee = n ? i * nl + e * Oe : 0, U = n ? i * o.stackRatio : c.value.height, q = c.value.bottom - Ee - U * R / H, fe = c.value.bottom - Ee - U * re / F, De = o.series.map((Q, me) => {
1627
- const G = k.value.useIndividualScale ? (o.absoluteValues[me] + Math.abs(R)) / H : Pt(Q);
1628
- return {
1629
- x: W(c.value.left + se.value.plot / 2 + se.value.plot * me),
1630
- y: W(c.value.bottom - Ee - U * G),
1631
- value: o.absoluteValues[me],
1632
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[me] || ""
1633
- };
1634
- }), Ne = o.absoluteValues.map((Q) => D.min >= 0 ? (Q - Math.abs(D.min)) / (D.max - Math.abs(D.min)) : (Q + Math.abs(D.min)) / (D.max + Math.abs(D.min))), $l = o.series.map((Q, me) => ({
1635
- x: W(c.value.left + se.value.plot / 2 + se.value.plot * me),
1636
- y: W(c.value.bottom - Ee - (U * Ne[me] || 0)),
1637
- value: o.absoluteValues[me],
1638
- comment: o.comments && o.comments.slice(p.value.start, p.value.end)[me] || ""
1639
- })), Be = M.ticks.map((Q) => ({
1640
- y: Q >= 0 ? q - U * (Q / H) : q + U * Math.abs(Q) / H,
1641
- value: Q,
1642
- prefix: o.prefix || t.value.chart.labels.prefix,
1643
- suffix: o.suffix || t.value.chart.labels.suffix,
1644
- datapoint: o
1645
- })), Lt = D.ticks.map((Q) => {
1646
- const me = (Q - D.min) / (D.max - D.min);
1647
- return {
1648
- y: Q >= 0 ? fe - U * me : fe + U * me,
1649
- value: Q,
1650
- prefix: o.prefix || t.value.chart.labels.prefix,
1651
- suffix: o.suffix || t.value.chart.labels.suffix,
1652
- datapoint: o
1653
- };
1654
- });
1655
- return A.value[o.scaleLabel].name = o.name, A.value[o.scaleLabel].groupName = o.scaleLabel, A.value[o.scaleLabel].groupColor = t.value.chart.grid.labels.yAxis.groupColor || o.color, A.value[o.scaleLabel].color = o.color, A.value[o.scaleLabel].scaleYLabels = o.autoScaling ? Lt : Be, A.value[o.scaleLabel].zeroPosition = o.autoScaling ? fe : q, A.value[o.scaleLabel].individualMax = o.autoScaling ? F : H, A.value[o.scaleLabel].scaleLabel = o.scaleLabel, A.value[o.scaleLabel].id = o.id, A.value[o.scaleLabel].yOffset = Ee, A.value[o.scaleLabel].individualHeight = U, A.value[o.scaleLabel].autoScaleYLabels = Lt, A.value[o.scaleLabel].unique = Bt.value.filter((Q) => Q.scaleLabel === o.scaleLabel).length === 1, {
1656
- ...o,
1657
- yOffset: Ee,
1658
- autoScaleYLabels: Lt,
1659
- individualHeight: U,
1660
- scaleYLabels: o.autoScaling ? Lt : Be,
1661
- individualScale: o.autoScaling ? D : M,
1662
- individualMax: o.autoScaling ? F : H,
1663
- zeroPosition: o.autoScaling ? fe : q,
1664
- plots: o.autoScaling ? $l : De,
1665
- groupId: A.value[o.scaleLabel].groupId
1666
- };
1667
- });
1668
- }), Sl = x(() => {
1669
- const l = Pe.value.map((i) => ({
1670
- name: i.name,
1671
- color: i.color,
1672
- scale: i.individualScale,
1673
- scaleYLabels: i.scaleYLabels,
1674
- zero: i.zeroPosition,
1675
- max: i.individualMax,
1676
- scaleLabel: i.scaleLabel || "",
1677
- id: i.id,
1678
- yOffset: i.yOffset || 0,
1679
- individualHeight: i.individualHeight || c.value.height,
1680
- autoScaleYLabels: i.autoScaleYLabels
1681
- })), u = yt.value.map((i) => ({
1682
- name: i.name,
1683
- color: i.color,
1684
- scale: i.individualScale,
1685
- scaleYLabels: i.scaleYLabels,
1686
- zero: i.zeroPosition,
1687
- max: i.individualMax,
1688
- scaleLabel: i.scaleLabel || "",
1689
- id: i.id,
1690
- yOffset: i.yOffset || 0,
1691
- individualHeight: i.individualHeight || c.value.height
1692
- })), e = ot.value.map((i) => ({
1693
- name: i.name,
1694
- color: i.color,
1695
- scale: i.individualScale,
1696
- scaleYLabels: i.scaleYLabels,
1697
- // FIX
1698
- zero: i.zeroPosition,
1699
- max: i.individualMax,
1700
- scaleLabel: i.scaleLabel || "",
1701
- id: i.id,
1702
- yOffset: i.yOffset || 0,
1703
- individualHeight: i.individualHeight || c.value.height
1704
- })), n = k.value.useIndividualScale && !k.value.isStacked ? Object.values(A.value) : [...l, ...u, ...e], a = n.flatMap((i) => i).length;
1705
- return n.flatMap((i, o) => {
1706
- let z = 0;
1707
- z = k.value.isStacked ? c.value.left : c.value.left / a * (o + 1);
1708
- const B = k.value.useIndividualScale && !k.value.isStacked ? i.unique ? i.name : i.groupName : i.name;
1709
- return {
1710
- unique: i.unique,
1711
- id: i.id,
1712
- groupId: i.groupId,
1713
- scaleLabel: i.scaleLabel,
1714
- name: Le(
1715
- t.value.chart.grid.labels.yAxis.serieNameFormatter,
1716
- B,
1717
- B,
1718
- i
1719
- ),
1720
- color: k.value.useIndividualScale && !k.value.isStacked ? i.unique ? i.color : i.groupColor : i.color,
1721
- scale: i.scale,
1722
- yOffset: i.yOffset,
1723
- individualHeight: i.individualHeight,
1724
- x: z,
1725
- yLabels: i.scaleYLabels || i.scale.ticks.map((E) => ({
1726
- y: E >= 0 ? i.zero - i.individualHeight * (E / i.max) : i.zero + i.individualHeight * Math.abs(E) / i.max,
1727
- value: E
1728
- }))
1729
- };
1730
- });
1731
- }), za = x(() => {
1732
- const l = t.value.line.interLine || {}, u = l.pairs || [], e = l.colors || [];
1733
- if (!u.length) return [];
1734
- const n = [];
1735
- return u.forEach((a, i) => {
1736
- const [o, z] = Array.isArray(a) ? a : [a.a, a.b];
1737
- if (!o || !z) return;
1738
- const B = Pe.value.find((M) => M.name === o), E = Pe.value.find((M) => M.name === z);
1739
- if (!B || !E || B.type !== "line" || E.type !== "line") return;
1740
- const $ = e?.[i]?.[0] ?? B.color, I = e?.[i]?.[1] ?? E.color;
1741
- Jo({
1742
- lineA: B.plots,
1743
- lineB: E.plots,
1744
- smoothA: !!B.smooth,
1745
- smoothB: !!E.smooth,
1746
- colorLineA: $,
1747
- colorLineB: I,
1748
- sampleStepPx: 2,
1749
- cutNullValues: t.value.line.cutNullValues
1750
- }).forEach((M, D) => {
1751
- n.push({ ...M, key: `inter_${o}_${z}_${i}_${D}` });
1752
- });
1753
- }), n;
1754
- }), Ta = x(() => ({
1755
- datapoint: pt.value,
1756
- seriesIndex: L.value,
1757
- series: Ze.value,
1758
- bars: yt.value,
1759
- lines: Pe.value,
1760
- plots: ot.value,
1761
- config: t.value
1762
- })), ol = x(() => {
1763
- const l = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter, u = cn({
1764
- useUTC: l.useUTC,
1765
- locale: vn[l.locale] || { months: [], shortMonths: [], days: [], shortDays: [] },
1766
- januaryAsYear: l.januaryAsYear
1767
- });
1768
- return (e, n) => {
1769
- const i = t.value.chart.grid.labels.xAxisLabels.values?.[e];
1770
- return i == null ? "" : u.formatDate(new Date(i), n);
1771
- };
1772
- }), ea = x(() => (t.value.chart.grid.labels.xAxisLabels.values || []).map((u, e) => ({
1773
- text: ol.value(e, t.value.chart.zoom.timeFormat),
1774
- absoluteIndex: e
1775
- }))), Pl = g(!1), Ia = x(() => {
1776
- let l = "", u = "";
1777
- if (t.value.chart.zoom.preview.enable)
1778
- return { left: l, right: u };
1779
- Pl.value = !1;
1780
- const e = t.value.chart.zoom.customFormat;
1781
- if (Wl(e))
1782
- try {
1783
- const n = e({
1784
- absoluteIndex: p.value.start,
1785
- seriesIndex: p.value.start,
1786
- datapoint: pt.value
1787
- }), a = e({
1788
- absoluteIndex: p.value.end - 1,
1789
- seriesIndex: p.value.end - 1,
1790
- datapoint: pt.value
1791
- });
1792
- typeof n == "string" && typeof a == "string" && (l = n, u = a, Pl.value = !0);
1793
- } catch {
1794
- console.warn("Custom format cannot be applied on zoom labels."), Pl.value = !1;
1795
- }
1796
- if (!Pl.value) {
1797
- l = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat ? ea.value[p.value.start]?.text || "" : _e.value[0]?.text || "";
1798
- const n = Math.max(p.value.start, p.value.end - 1);
1799
- u = t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat ? ea.value[n]?.text || "" : _e.value.at(-1)?.text || "";
1800
- }
1801
- return { left: l, right: u };
1802
- }), Ao = x(() => {
1803
- let l = "", u = pt.value.map((a) => a.value).filter((a) => Hl(a) && a !== null).reduce((a, i) => Math.abs(a) + Math.abs(i), 0);
1804
- const e = _e.value[L.value], n = t.value.chart.tooltip.customFormat;
1805
- if (Wl(n) && Qo(() => n({
1806
- absoluteIndex: L.value + p.value.start,
1807
- seriesIndex: L.value,
1808
- datapoint: pt.value,
1809
- series: Ze.value,
1810
- bars: yt.value,
1811
- lines: Pe.value,
1812
- plots: ot.value,
1813
- config: t.value
1814
- })))
1815
- return n({
1816
- absoluteIndex: L.value + p.value.start,
1817
- seriesIndex: L.value,
1818
- datapoint: pt.value,
1819
- series: Ze.value,
1820
- bars: yt.value,
1821
- lines: Pe.value,
1822
- plots: ot.value,
1823
- config: t.value
1824
- });
1825
- if (e && e.text && t.value.chart.tooltip.showTimeLabel) {
1826
- const a = ol.value(L.value + p.value.start, t.value.chart.tooltip.timeFormat);
1827
- l += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.chart.tooltip.borderColor}; width:100%">${t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.tooltip.useDefaultTimeFormat ? a : e.text}</div>`;
1828
- }
1829
- return pt.value.forEach((a) => {
1830
- if (Hl(a.value)) {
1831
- let i = "", o = "";
1832
- switch (we.value[a.type]) {
1833
- case "bar":
1834
- i = `<svg viewBox="0 0 40 40" height="14" width="14">${cl.pattern ? `<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${a.color}" />` : ""}<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${cl.pattern ? `url(#pattern_${Y.value}_${a.slotAbsoluteIndex}` : a.color}" /></svg>`;
1835
- break;
1836
- case "line":
1837
- !a.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(a.shape) ? o = `<circle cx="10" cy="8" r="4" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${a.color}" />` : a.shape === "triangle" ? o = `<path d="${dt({ plot: { x: 10, y: 8 }, radius: 4, sides: 3, rotation: 0.52 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "square" ? o = `<path d="${dt({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0.8 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "diamond" ? o = `<path d="${dt({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "pentagon" ? o = `<path d="${dt({ plot: { x: 10, y: 8 }, radius: 4, sides: 5, rotation: 0.95 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "hexagon" ? o = `<path d="${dt({ plot: { x: 10, y: 8 }, radius: 4, sides: 6, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : a.shape === "star" && (o = `<polygon stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${a.color}" points="${eo({ plot: { x: 10, y: 8 }, radius: 4 })}" />`), i = `<svg viewBox="0 0 20 12" height="14" width="20"><rect rx="1.5" x="0" y="6.5" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="0.5" height="3" width="20" fill="${a.color}" />${o}</svg>`;
1838
- break;
1839
- case "plot":
1840
- if (!a.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(a.shape)) {
1841
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" fill="${a.color}" /></svg>`;
1842
- break;
1843
- }
1844
- if (a.shape === "star") {
1845
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><polygon stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" fill="${a.color}" points="${eo({ plot: { x: 6, y: 6 }, radius: 5 })}" /></svg>`;
1846
- break;
1847
- }
1848
- if (a.shape === "triangle") {
1849
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${dt({ plot: { x: 6, y: 6 }, radius: 6, sides: 3, rotation: 0.52 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
1850
- break;
1851
- }
1852
- if (a.shape === "square") {
1853
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${dt({ plot: { x: 6, y: 6 }, radius: 6, sides: 4, rotation: 0.8 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
1854
- break;
1855
- }
1856
- if (a.shape === "diamond") {
1857
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${dt({ plot: { x: 6, y: 6 }, radius: 5, sides: 4, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
1858
- break;
1859
- }
1860
- if (a.shape === "pentagon") {
1861
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${dt({ plot: { x: 6, y: 6 }, radius: 5, sides: 5, rotation: 0.95 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
1862
- break;
1863
- }
1864
- if (a.shape === "hexagon") {
1865
- i = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${dt({ plot: { x: 6, y: 6 }, radius: 5, sides: 6, rotation: 0 }).path}" fill="${a.color}" stroke="${t.value.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
1866
- break;
1867
- }
1868
- }
1869
- l += `<div style="display:flex;flex-direction:row; align-items:center;gap:3px;"><div style="width:20px">${i}</div> ${a.name}: <b>${t.value.chart.tooltip.showValue ? Le(
1870
- a.type === "line" ? t.value.line.labels.formatter : a.type === "bar" ? t.value.bar.labels.formatter : t.value.plot.labels.formatter,
1871
- a.value,
1872
- Qe({
1873
- p: a.prefix,
1874
- v: a.value,
1875
- s: a.suffix,
1876
- r: t.value.chart.tooltip.roundingValue
1877
- }),
1878
- { datapoint: a }
1879
- ) : ""}</b> ${t.value.chart.tooltip.showPercentage ? `(${Qe({
1880
- v: W(Math.abs(a.value) / u * 100),
1881
- s: "%",
1882
- r: t.value.chart.tooltip.roundingPercentage
1883
- })})` : ""}</div>`, t.value.chart.comments.showInTooltip && a.comments.length && a.comments.slice(p.value.start, p.value.end)[L.value] && (l += `<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${a.color}">${a.comments.slice(p.value.start, p.value.end)[L.value]}</div>`);
1884
- }
1885
- }), `<div style="border-radius:4px;padding:12px;font-variant-numeric: tabular-nums;color:${t.value.chart.tooltip.color}">${l}</div>`;
1886
- }), Na = x(() => {
1887
- if (at.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
1888
- const l = Ke.value.map((e) => ({
1889
- label: e.name,
1890
- color: e.color,
1891
- type: e.type
1892
- })), u = [];
1893
- return _e.value.forEach((e, n) => {
1894
- const a = t.value.table.useDefaultTimeFormat ? [e.text] : [ol.value(n + p.value.start, t.value.table.timeFormat)];
1895
- Ke.value.forEach((i) => {
1896
- a.push(Ve(i.absoluteValues[n]) ? Number(i.absoluteValues[n].toFixed(t.value.table.rounding)) : "");
1897
- }), u.push(a);
1898
- }), { head: l, body: u };
1899
- }), Ol = x(() => {
1900
- const l = t.value.table.showSum;
1901
- let u = [""].concat(Ke.value.map((i) => i.name));
1902
- l && (u = u.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>'));
1903
- let e = [];
1904
- for (let i = 0; i < T.value; i += 1) {
1905
- const o = Ke.value.map((z) => z.absoluteValues[i] ?? 0).reduce((z, B) => z + B, 0);
1906
- e.push(
1907
- [
1908
- t.value.table.useDefaultTimeFormat ? _e.value[i].text ?? "-" : ol.value(i + p.value.start, t.value.table.timeFormat)
1909
- ].concat(Ke.value.map(
1910
- (z) => Le(
1911
- z.type === "line" ? t.value.line.labels.formatter : z.type === "bar" ? t.value.bar.labels.formatter : t.value.plot.labels.formatter,
1912
- z.absoluteValues[i] ?? 0,
1913
- Qe({
1914
- p: z.prefix || t.value.chart.labels.prefix,
1915
- v: z.absoluteValues[i] ?? 0,
1916
- s: z.suffix || t.value.chart.labels.suffix,
1917
- r: t.value.table.rounding
1918
- })
1919
- )
1920
- )).concat(l ? (o ?? 0).toFixed(t.value.table.rounding) : [])
1921
- );
1922
- }
1923
- const n = {
1924
- th: {
1925
- backgroundColor: t.value.table.th.backgroundColor,
1926
- color: t.value.table.th.color,
1927
- outline: t.value.table.th.outline
1928
- },
1929
- td: {
1930
- backgroundColor: t.value.table.td.backgroundColor,
1931
- color: t.value.table.td.color,
1932
- outline: t.value.table.td.outline
1933
- },
1934
- breakpoint: t.value.table.responsiveBreakpoint
1935
- }, a = [t.value.table.columnNames.period].concat(Ke.value.map((i) => i.name)).concat(t.value.table.columnNames.total);
1936
- return { head: u, body: e, config: n, colNames: a };
1937
- });
1938
- function ta(l = null) {
1939
- const u = [[t.value.chart.title.text], [t.value.chart.title.subtitle.text], [""]], e = ["", ...Na.value.head.map((o) => o.label)], n = Na.value.body, a = u.concat([e]).concat(n), i = an(a);
1940
- l ? l(i) : on({ csvContent: i, title: t.value.chart.title.text || "vue-ui-xy" });
1941
- }
1942
- function Ra(l, u = null) {
1943
- Cl.value = l;
1944
- const e = Ke.value.map((n) => ({
1945
- name: n.name,
1946
- value: [null, void 0, NaN].includes(n.absoluteValues[u]) ? null : n.absoluteValues[u],
1947
- color: n.color,
1948
- type: n.type
1949
- }));
1950
- l ? (L.value = u, t.value.events.datapointEnter && t.value.events.datapointEnter({ datapoint: e, seriesIndex: u + p.value.start })) : (L.value = null, t.value.events.datapointLeave && t.value.events.datapointLeave({ datapoint: e, seriesIndex: u + p.value.start }));
1951
- }
1952
- function Fa() {
1953
- k.value.showTable = !k.value.showTable;
1954
- }
1955
- function Pa() {
1956
- k.value.dataLabels.show = !k.value.dataLabels.show;
1957
- }
1958
- function Oa() {
1959
- k.value.showTooltip = !k.value.showTooltip;
1960
- }
1961
- function Ba(l) {
1962
- Re.value = l, fl.value += 1;
1963
- }
1964
- function Ha() {
1965
- if (!t.value.responsiveProportionalSizing) {
1966
- w.value.dataLabels = t.value.chart.grid.labels.fontSize, w.value.yAxis = t.value.chart.grid.labels.axis.fontSize, w.value.xAxis = t.value.chart.grid.labels.xAxisLabels.fontSize, w.value.plotLabels = t.value.chart.labels.fontSize, Fe.value.plot = t.value.plot.radius, Fe.value.line = t.value.line.radius;
1967
- return;
1968
- }
1969
- w.value.dataLabels = ul({
1970
- relator: ye.value,
1971
- adjuster: 400,
1972
- source: t.value.chart.grid.labels.fontSize,
1973
- threshold: 10,
1974
- fallback: 10
1975
- }), w.value.yAxis = ul({
1976
- relator: ee.value,
1977
- adjuster: 1e3,
1978
- source: t.value.chart.grid.labels.axis.fontSize,
1979
- threshold: 10,
1980
- fallback: 10
1981
- }), w.value.xAxis = ul({
1982
- relator: ee.value,
1983
- adjuster: 1e3,
1984
- source: t.value.chart.grid.labels.xAxisLabels.fontSize,
1985
- threshold: 10,
1986
- fallback: 10
1987
- }), w.value.plotLabels = ul({
1988
- relator: ee.value,
1989
- adjuster: 800,
1990
- source: t.value.chart.labels.fontSize,
1991
- threshold: 10,
1992
- fallback: 10
1993
- }), Fe.value.plot = ul({
1994
- relator: ee.value,
1995
- adjuster: 800,
1996
- source: t.value.plot.radius,
1997
- threshold: 1,
1998
- fallback: 1
1999
- }), Fe.value.line = ul({
2000
- relator: ee.value,
2001
- adjuster: 800,
2002
- source: t.value.line.radius,
2003
- threshold: 1,
2004
- fallback: 1
2005
- });
2006
- }
2007
- function la() {
2008
- to(d.dataset) ? (oa({
2009
- componentName: "VueUiXy",
2010
- type: "dataset",
2011
- debug: _t.value
2012
- }), ct.value = !0) : d.dataset.forEach((u, e) => {
2013
- [null, void 0].includes(u.name) && (oa({
2014
- componentName: "VueUiXy",
2015
- type: "datasetSerieAttribute",
2016
- property: "name (string)",
2017
- index: e,
2018
- debug: _t.value
2019
- }), ct.value = !0);
2020
- }), _t.value && d.dataset.forEach((u) => {
2021
- u.series.forEach((e, n) => {
2022
- Hl(e) || console.warn(`VueUiXy has detected an unsafe value in your dataset:
2023
- -----> The serie '${u.name}' contains the value '${e}' at index ${n}.
2024
- '${e}' was converted to null to allow the chart to display.`);
2025
- });
2026
- }), to(d.dataset) || (ct.value = t.value.loading), gt.value = t.value.chart.userOptions.showOnChartHover, gl.value = t.value.chart.userOptions.keepStateOnChartLeave, Jt.value = !t.value.chart.userOptions.showOnChartHover, pl();
2027
- const l = 12;
2028
- if (t.value.responsive) {
2029
- const e = xe.value.parentNode;
2030
- Me.value && (Me.value.unobserve(dl.value), Me.value.disconnect());
2031
- const { height: n, width: a } = e.getBoundingClientRect();
2032
- let i = null, o = 0;
2033
- t.value.chart.title.show && pe.value && (i = pe.value, o = i.getBoundingClientRect().height);
2034
- let z = null, B = 0;
2035
- t.value.chart.zoom.show && ze.value > 6 && jt.value && He.value && He.value.$el && (z = He.value.$el, B = z.getBoundingClientRect().height);
2036
- let E = null, $ = 0;
2037
- t.value.chart.legend.show && st.value && (E = st.value, $ = E.getBoundingClientRect().height);
2038
- let I = 0;
2039
- It.value && (I = It.value.getBoundingClientRect().height);
2040
- let J = 0;
2041
- Nt.value && (J = Nt.value.getBoundingClientRect().height), ye.value = n - o - $ - B - I - J - l, ee.value = a, rt.value = `0 0 ${ee.value < 0 ? 10 : ee.value} ${ye.value < 0 ? 10 : ye.value}`, Ha();
2042
- const M = new ResizeObserver((D) => {
2043
- for (const R of D)
2044
- t.value.chart.title.show && pe.value ? o = pe.value.getBoundingClientRect().height : o = 0, He.value && He.value.$el ? B = He.value.$el.getBoundingClientRect().height : B = 0, st.value ? $ = st.value.getBoundingClientRect().height : $ = 0, It.value ? I = It.value.getBoundingClientRect().height : I = 0, Nt.value ? J = Nt.value.getBoundingClientRect().height : J = 0, requestAnimationFrame(() => {
2045
- ye.value = R.contentRect.height - o - $ - B - I - J - l, ee.value = R.contentBoxSize[0].inlineSize, rt.value = `0 0 ${ee.value < 0 ? 10 : ee.value} ${ye.value < 0 ? 10 : ye.value}`, Ha();
2046
- });
2047
- });
2048
- Me.value = M, dl.value = e, M.observe(e);
2049
- } else
2050
- ye.value = t.value.chart.height, ee.value = t.value.chart.width, w.value.dataLabels = t.value.chart.grid.labels.fontSize, w.value.yAxis = t.value.chart.grid.labels.axis.fontSize, w.value.xAxis = t.value.chart.grid.labels.xAxisLabels.fontSize, w.value.plotLabels = t.value.chart.labels.fontSize, Fe.value.plot = t.value.plot.radius, Fe.value.line = t.value.line.radius, rt.value = `0 0 ${ee.value} ${ye.value}`;
2051
- }
2052
- function Va(l) {
2053
- ke.value = {
2054
- x: l.clientX,
2055
- y: l.clientY
2056
- };
2057
- }
2058
- il(() => {
2059
- la(), Tl(), document.addEventListener("mousemove", Va, { passive: !0 }), document.addEventListener("scroll", va, { passive: !0 });
2060
- }), Xt(() => {
2061
- document.removeEventListener("scroll", va, { passive: !0 }), document.removeEventListener("mousemove", Va, { passive: !0 }), Me.value && (Me.value.unobserve(dl.value), Me.value.disconnect(), Me.value = null);
2062
- }), dn({
2063
- timeLabelsEls: ht,
2064
- timeLabels: _e,
2065
- slicer: p,
2066
- configRef: t,
2067
- rotationPath: ["chart", "grid", "labels", "xAxisLabels", "rotation"],
2068
- autoRotatePath: ["chart", "grid", "labels", "xAxisLabels", "autoRotate", "enable"],
2069
- isAutoSize: X,
2070
- height: ye,
2071
- width: ee,
2072
- rotation: t.value.chart.grid.labels.xAxisLabels.autoRotate.angle
2073
- });
2074
- const Bl = g(!1), Ea = g(null), Da = g(200), zo = x(
2075
- () => L.value ?? O.value ?? 0
2076
- );
2077
- function To() {
2078
- const l = Math.ceil(Da.value || 200);
2079
- return Math.min(Math.max(l, 1), 200);
2080
- }
2081
- function Io() {
2082
- const l = To(), u = 200, e = Math.max(1, T.value), n = c.value.width / e, i = c.value.left + zo.value * n + n / 2 - l / 2 - (u - l) / 2, o = c.value.left - (u - l) / 2, z = c.value.right - (u + l) / 2, B = Math.max(o, Math.min(i, z));
2083
- return W(B);
2084
- }
2085
- il(() => {
2086
- let l = null, u = null;
2087
- const e = (i) => {
2088
- cancelAnimationFrame(u), u = requestAnimationFrame(() => {
2089
- Da.value = Math.min(Math.max(Math.ceil(i || 0), 1), 200);
2090
- });
2091
- }, n = new ResizeObserver((i) => {
2092
- let o = i.find((z) => z.target === l) || i[0];
2093
- o && e(o.contentRect.width || 200);
2094
- }), a = Ua((i) => {
2095
- const o = Ea.value;
2096
- l && l !== o && (n.unobserve(l), l = null), o && o !== l && (Yt(() => {
2097
- o.offsetParent !== null && e(o.offsetWidth || o.getBoundingClientRect().width || 200);
2098
- }), n.observe(o), l = o), i(() => {
2099
- l && (n.unobserve(l), l = null);
2100
- });
2101
- });
2102
- Xt(() => {
2103
- try {
2104
- l && n.unobserve(l), n.disconnect(), a();
2105
- } catch {
2106
- }
2107
- });
2108
- });
2109
- const No = x(() => {
2110
- if ([null, void 0].includes(L.value) && [null, void 0].includes(O.value)) return "";
2111
- const l = (L.value != null ? L.value : 0) || (O.value != null ? O.value : 0), u = t.value.chart.timeTag.customFormat;
2112
- if (Bl.value = !1, Wl(u))
2113
- try {
2114
- const e = u({
2115
- absoluteIndex: l + p.value.start,
2116
- seriesIndex: l,
2117
- datapoint: pt.value,
2118
- bars: yt.value,
2119
- lines: Pe.value,
2120
- plots: ot.value,
2121
- config: t.value
2122
- });
2123
- if (typeof e == "string")
2124
- return Bl.value = !0, e;
2125
- } catch {
2126
- console.warn("Custom format cannot be applied on timeTag."), Bl.value = !1;
2127
- }
2128
- if (!Bl.value)
2129
- return [null, void 0].includes(_e.value[l]) ? "" : t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.timeTag.useDefaultFormat ? ol.value(l + p.value.start, t.value.chart.timeTag.timeFormat) : _e.value[l].text;
2130
- });
2131
- it(() => d.dataset, (l) => {
2132
- Array.isArray(l) && l.length > 0 && (ct.value = !1), ze.value = Math.max(...he.value.map((u) => Se(u.series).length)), p.value = {
2133
- start: 0,
2134
- end: ze.value
2135
- }, St.value += 1, Kt.value += 1, vt();
2136
- }, { deep: !0 }), it(() => d.config, (l) => {
2137
- oe.value || (t.value = xl()), la(), ml.value += 1, Zt.value += 1, pl(), vt();
2138
- }, { deep: !0 });
2139
- const aa = g(!1);
2140
- function Wa() {
2141
- const l = xe.value?.parentNode;
2142
- if (!l) {
2143
- aa.value = !1;
2144
- return;
2145
- }
2146
- const u = l.getBoundingClientRect();
2147
- aa.value = u.width > 2 && u.height > 2;
2148
- }
2149
- il(() => {
2150
- Wa();
2151
- const l = new ResizeObserver(() => {
2152
- Wa(), aa.value && (la(), vt(), Tl());
2153
- });
2154
- xe.value?.parentNode && l.observe(xe.value.parentNode);
2155
- }), it(t, () => {
2156
- pl();
2157
- }, { immediate: !0 });
2158
- const _l = x(() => {
2159
- const l = t.value.table.useDialog && !t.value.showTable, u = k.value.showTable;
2160
- return {
2161
- component: l ? Ut : bn,
2162
- title: `${t.value.chart.title.text}${t.value.chart.title.subtitle.text ? `: ${t.value.chart.title.subtitle.text}` : ""}`,
2163
- props: l ? {
2164
- backgroundColor: t.value.table.th.backgroundColor,
2165
- color: t.value.table.th.color,
2166
- headerColor: t.value.table.th.color,
2167
- headerBg: t.value.table.th.backgroundColor,
2168
- isFullscreen: Re.value,
2169
- fullscreenParent: xe.value,
2170
- forcedWidth: Math.min(800, window.innerWidth * 0.8)
2171
- } : {
2172
- hideDetails: !0,
2173
- config: {
2174
- open: u,
2175
- maxHeight: 1e4,
2176
- body: {
2177
- backgroundColor: t.value.chart.backgroundColor,
2178
- color: t.value.chart.color
2179
- },
2180
- head: {
2181
- backgroundColor: t.value.chart.backgroundColor,
2182
- color: t.value.chart.color
2183
- }
2184
- }
2185
- }
2186
- };
2187
- });
2188
- it(() => k.value.showTable, (l) => {
2189
- t.value.showTable || (l && t.value.table.useDialog && bt.value ? bt.value.open() : bt.value && bt.value.close && bt.value.close());
2190
- });
2191
- function Xa() {
2192
- k.value.showTable = !1, j.value && j.value.setTableIconState(!1);
2193
- }
2194
- return Gl({
2195
- getData: yo,
2196
- getImage: ko,
2197
- generatePdf: h,
2198
- generateImage: S,
2199
- generateCsv: ta,
2200
- toggleStack: ba,
2201
- toggleTable: Fa,
2202
- toggleLabels: Pa,
2203
- toggleTooltip: Oa,
2204
- toggleAnnotator: Kl,
2205
- toggleFullscreen: Ba
2206
- }), (l, u) => (s(), r("div", {
2207
- id: `vue-ui-xy_${Y.value}`,
2208
- class: Xe(`vue-ui-xy ${Re.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${t.value.useCssAnimation ? "" : "vue-ui-dna"}`),
2209
- ref_key: "chart",
2210
- ref: xe,
2211
- style: _(`background:${t.value.chart.backgroundColor}; color:${t.value.chart.color};width:100%;font-family:${t.value.chart.fontFamily};${t.value.responsive ? "height: 100%" : ""}`),
2212
- onMouseenter: u[10] || (u[10] = () => ha(!0)),
2213
- onMouseleave: u[11] || (u[11] = () => ha(!1))
2214
- }, [
2215
- t.value.chart.userOptions.buttons.annotator && Ae.value ? (s(), Je(v(rl), {
2216
- key: 0,
2217
- svgRef: Ae.value,
2218
- backgroundColor: t.value.chart.backgroundColor,
2219
- color: t.value.chart.color,
2220
- active: Ce.value,
2221
- onClose: Kl
2222
- }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : f("", !0),
2223
- So.value ? (s(), r("div", {
2224
- key: 1,
2225
- ref_key: "noTitle",
2226
- ref: Nt,
2227
- class: "vue-data-ui-no-title-space",
2228
- style: "height:36px; width: 100%; background:transparent"
2229
- }, null, 512)) : f("", !0),
2230
- t.value.chart.title.show ? (s(), r("div", {
2231
- key: 2,
2232
- ref_key: "chartTitle",
2233
- ref: pe,
2234
- class: "vue-ui-xy-title",
2235
- style: _(`font-family:${t.value.chart.fontFamily}`)
2236
- }, [
2237
- (s(), Je(fn, {
2238
- key: `title_${ml.value}`,
2239
- config: {
2240
- title: {
2241
- cy: "xy-div-title",
2242
- ...t.value.chart.title
2243
- },
2244
- subtitle: {
2245
- cy: "xy-div-subtitle",
2246
- ...t.value.chart.title.subtitle
2247
- }
2248
- }
2249
- }, null, 8, ["config"]))
2250
- ], 4)) : f("", !0),
2251
- y("div", {
2252
- id: `legend-top-${Y.value}`
2253
- }, null, 8, En),
2254
- t.value.chart.userOptions.show && (gl.value || Jt.value) ? (s(), Je(v(de), {
2255
- ref_key: "userOptionsRef",
2256
- ref: j,
2257
- key: `user_options_${fl.value}`,
2258
- backgroundColor: t.value.chart.backgroundColor,
2259
- color: t.value.chart.color,
2260
- isPrinting: v(ie),
2261
- isImaging: v(m),
2262
- uid: Y.value,
2263
- hasTooltip: t.value.chart.userOptions.buttons.tooltip && t.value.chart.tooltip.show,
2264
- hasPdf: t.value.chart.userOptions.buttons.pdf,
2265
- hasXls: t.value.chart.userOptions.buttons.csv,
2266
- hasImg: t.value.chart.userOptions.buttons.img,
2267
- hasLabel: t.value.chart.userOptions.buttons.labels,
2268
- hasTable: t.value.chart.userOptions.buttons.table,
2269
- hasStack: N.dataset.length > 1 && t.value.chart.userOptions.buttons.stack,
2270
- hasFullscreen: t.value.chart.userOptions.buttons.fullscreen,
2271
- isStacked: k.value.isStacked,
2272
- isFullscreen: Re.value,
2273
- chartElement: l.$refs.chart,
2274
- position: t.value.chart.userOptions.position,
2275
- isTooltip: k.value.showTooltip,
2276
- titles: { ...t.value.chart.userOptions.buttonTitles },
2277
- hasAnnotator: t.value.chart.userOptions.buttons.annotator,
2278
- isAnnotation: Ce.value,
2279
- callbacks: t.value.chart.userOptions.callbacks,
2280
- tableDialog: t.value.table.useDialog,
2281
- printScale: t.value.chart.userOptions.print.scale,
2282
- onToggleFullscreen: Ba,
2283
- onGeneratePdf: v(h),
2284
- onGenerateCsv: ta,
2285
- onGenerateImage: v(S),
2286
- onToggleTable: Fa,
2287
- onToggleLabels: Pa,
2288
- onToggleStack: ba,
2289
- onToggleTooltip: Oa,
2290
- onToggleAnnotator: Kl,
2291
- style: _({
2292
- visibility: gl.value ? Jt.value ? "visible" : "hidden" : "visible"
2293
- })
2294
- }, qa({ _: 2 }, [
2295
- l.$slots.menuIcon ? {
2296
- name: "menuIcon",
2297
- fn: be(({ isOpen: e, color: n }) => [
2298
- K(l.$slots, "menuIcon", At(zt({ isOpen: e, color: n })), void 0, !0)
2299
- ]),
2300
- key: "0"
2301
- } : void 0,
2302
- l.$slots.optionTooltip ? {
2303
- name: "optionTooltip",
2304
- fn: be(() => [
2305
- K(l.$slots, "optionTooltip", {}, void 0, !0)
2306
- ]),
2307
- key: "1"
2308
- } : void 0,
2309
- l.$slots.optionPdf ? {
2310
- name: "optionPdf",
2311
- fn: be(() => [
2312
- K(l.$slots, "optionPdf", {}, void 0, !0)
2313
- ]),
2314
- key: "2"
2315
- } : void 0,
2316
- l.$slots.optionCsv ? {
2317
- name: "optionCsv",
2318
- fn: be(() => [
2319
- K(l.$slots, "optionCsv", {}, void 0, !0)
2320
- ]),
2321
- key: "3"
2322
- } : void 0,
2323
- l.$slots.optionImg ? {
2324
- name: "optionImg",
2325
- fn: be(() => [
2326
- K(l.$slots, "optionImg", {}, void 0, !0)
2327
- ]),
2328
- key: "4"
2329
- } : void 0,
2330
- l.$slots.optionTable ? {
2331
- name: "optionTable",
2332
- fn: be(() => [
2333
- K(l.$slots, "optionTable", {}, void 0, !0)
2334
- ]),
2335
- key: "5"
2336
- } : void 0,
2337
- l.$slots.optionLabels ? {
2338
- name: "optionLabels",
2339
- fn: be(() => [
2340
- K(l.$slots, "optionLabels", {}, void 0, !0)
2341
- ]),
2342
- key: "6"
2343
- } : void 0,
2344
- l.$slots.optionStack ? {
2345
- name: "optionStack",
2346
- fn: be(() => [
2347
- K(l.$slots, "optionStack", {}, void 0, !0)
2348
- ]),
2349
- key: "7"
2350
- } : void 0,
2351
- l.$slots.optionFullscreen ? {
2352
- name: "optionFullscreen",
2353
- fn: be(({ toggleFullscreen: e, isFullscreen: n }) => [
2354
- K(l.$slots, "optionFullscreen", At(zt({ toggleFullscreen: e, isFullscreen: n })), void 0, !0)
2355
- ]),
2356
- key: "8"
2357
- } : void 0,
2358
- l.$slots.optionAnnotator ? {
2359
- name: "optionAnnotator",
2360
- fn: be(({ toggleAnnotator: e, isAnnotator: n }) => [
2361
- K(l.$slots, "optionAnnotator", At(zt({ toggleAnnotator: e, isAnnotator: n })), void 0, !0)
2362
- ]),
2363
- key: "9"
2364
- } : void 0
2365
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasLabel", "hasTable", "hasStack", "hasFullscreen", "isStacked", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "callbacks", "tableDialog", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : f("", !0),
2366
- (s(), r("svg", {
2367
- ref_key: "svgRef",
2368
- ref: Ae,
2369
- xmlns: "http://www.w3.org/2000/svg",
2370
- class: Xe([{ "vue-data-ui-fullscreen--on": Re.value, "vue-data-ui-fulscreen--off": !Re.value }, "vue-ui-xy-svg vue-data-ui-svg"]),
2371
- width: "100%",
2372
- viewBox: rt.value,
2373
- style: _({
2374
- background: "transparent",
2375
- color: t.value.chart.color,
2376
- fontFamily: t.value.chart.fontFamily
2377
- }),
2378
- "aria-label": wo.value,
2379
- role: "img",
2380
- "aria-live": "polite",
2381
- preserveAspectRatio: "xMidYMid",
2382
- onMousemove: bo,
2383
- onMouseleave: jl,
2384
- onClick: xo
2385
- }, [
2386
- y("g", {
2387
- ref_key: "G",
2388
- ref: ql,
2389
- class: "vue-data-ui-g"
2390
- }, [
2391
- Wt(v(Gt)),
2392
- l.$slots["chart-background"] ? (s(), r("foreignObject", {
2393
- key: 0,
2394
- x: c.value.left + te.value < 0 ? 0 : c.value.left + te.value,
2395
- y: c.value.top,
2396
- width: c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / T.value) < 0 ? 0 : c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / T.value),
2397
- height: c.value.height < 0 ? 0 : c.value.height,
2398
- style: {
2399
- pointerEvents: "none"
2400
- }
2401
- }, [
2402
- K(l.$slots, "chart-background", {}, void 0, !0)
2403
- ], 8, Wn)) : f("", !0),
2404
- T.value > 0 ? (s(), r("g", Xn, [
2405
- y("g", Yn, [
2406
- t.value.chart.grid.labels.xAxis.showBaseline ? (s(), r("line", {
2407
- key: 0,
2408
- stroke: t.value.chart.grid.stroke,
2409
- "stroke-width": "1",
2410
- x1: c.value.left + te.value,
2411
- x2: c.value.right - te.value,
2412
- y1: v(Z)(c.value.bottom),
2413
- y2: v(Z)(c.value.bottom),
2414
- "stroke-linecap": "round",
2415
- style: { animation: "none !important" }
2416
- }, null, 8, Gn)) : f("", !0),
2417
- k.value.useIndividualScale ? t.value.chart.grid.showHorizontalLines ? (s(!0), r(b, { key: 2 }, C(Sl.value, (e) => (s(), r("g", null, [
2418
- e.id === P.value && e.yLabels.length ? (s(!0), r(b, { key: 0 }, C(e.yLabels, (n) => (s(), r("line", {
2419
- x1: c.value.left + te.value,
2420
- x2: c.value.right - te.value,
2421
- y1: v(Z)(n.y),
2422
- y2: v(Z)(n.y),
2423
- stroke: e.color,
2424
- "stroke-width": 0.5,
2425
- "stroke-linecap": "round",
2426
- style: { animation: "none !important" }
2427
- }, null, 8, Kn))), 256)) : e.yLabels.length ? (s(!0), r(b, { key: 1 }, C(e.yLabels, (n) => (s(), r("line", {
2428
- x1: c.value.left + te.value,
2429
- x2: c.value.right - te.value,
2430
- y1: v(Z)(n.y),
2431
- y2: v(Z)(n.y),
2432
- stroke: t.value.chart.grid.stroke,
2433
- "stroke-width": 0.5,
2434
- "stroke-linecap": "round",
2435
- style: { animation: "none !important" }
2436
- }, null, 8, Jn))), 256)) : f("", !0)
2437
- ]))), 256)) : f("", !0) : (s(), r(b, { key: 1 }, [
2438
- t.value.chart.grid.labels.yAxis.showBaseline ? (s(), r("line", {
2439
- key: 0,
2440
- stroke: t.value.chart.grid.stroke,
2441
- "stroke-width": "1",
2442
- x1: c.value.left + te.value,
2443
- x2: c.value.left + te.value,
2444
- y1: v(Z)(c.value.top),
2445
- y2: v(Z)(c.value.bottom),
2446
- "stroke-linecap": "round",
2447
- style: { animation: "none !important" }
2448
- }, null, 8, Un)) : f("", !0),
2449
- t.value.chart.grid.showHorizontalLines ? (s(), r("g", qn, [
2450
- (s(!0), r(b, null, C(Ma.value, (e) => (s(), r("line", {
2451
- x1: c.value.left + te.value,
2452
- x2: c.value.right,
2453
- y1: v(Z)(e.y),
2454
- y2: v(Z)(e.y),
2455
- stroke: t.value.chart.grid.stroke,
2456
- "stroke-width": 0.5,
2457
- "stroke-linecap": "round",
2458
- style: { animation: "none !important" }
2459
- }, null, 8, Zn))), 256))
2460
- ])) : f("", !0)
2461
- ], 64)),
2462
- t.value.chart.grid.showVerticalLines ? (s(), r("g", Qn, [
2463
- y("path", {
2464
- d: io.value,
2465
- "stroke-width": 0.5,
2466
- stroke: t.value.chart.grid.stroke,
2467
- "stroke-linecap": "round",
2468
- style: { animation: "none !important" }
2469
- }, null, 8, jn)
2470
- ])) : f("", !0),
2471
- t.value.chart.grid.labels.xAxisLabels.show ? (s(), r("g", eu, [
2472
- y("path", {
2473
- d: so.value,
2474
- stroke: t.value.chart.grid.stroke,
2475
- "stroke-width": 1,
2476
- "stroke-linecap": "round",
2477
- style: { animation: "none !important" }
2478
- }, null, 8, tu)
2479
- ])) : f("", !0)
2480
- ]),
2481
- (s(!0), r(b, null, C(yt.value, (e, n) => (s(), r("defs", {
2482
- key: `def_rect_${n}`
2483
- }, [
2484
- l.$slots["bar-gradient"] ? K(l.$slots, "bar-gradient", Vt({
2485
- key: 0,
2486
- ref_for: !0
2487
- }, { series: e, positiveId: `rectGradient_pos_${n}_${Y.value}`, negativeId: `rectGradient_neg_${n}_${Y.value}` }), void 0, !0) : (s(), r(b, { key: 1 }, [
2488
- y("linearGradient", {
2489
- id: `rectGradient_pos_${n}_${Y.value}`,
2490
- x2: "0%",
2491
- y2: "100%"
2492
- }, [
2493
- y("stop", {
2494
- offset: "0%",
2495
- "stop-color": e.color
2496
- }, null, 8, au),
2497
- y("stop", {
2498
- offset: "62%",
2499
- "stop-color": `${v(Dt)(e.color, 0.02)}`
2500
- }, null, 8, ou),
2501
- y("stop", {
2502
- offset: "100%",
2503
- "stop-color": `${v(Dt)(e.color, 0.05)}`
2504
- }, null, 8, nu)
2505
- ], 8, lu),
2506
- y("linearGradient", {
2507
- id: `rectGradient_neg_${n}_${Y.value}`,
2508
- x2: "0%",
2509
- y2: "100%"
2510
- }, [
2511
- y("stop", {
2512
- offset: "0%",
2513
- "stop-color": `${v(Dt)(e.color, 0.05)}`
2514
- }, null, 8, iu),
2515
- y("stop", {
2516
- offset: "38%",
2517
- "stop-color": `${v(Dt)(e.color, 0.02)}`
2518
- }, null, 8, su),
2519
- y("stop", {
2520
- offset: "100%",
2521
- "stop-color": e.color
2522
- }, null, 8, ru)
2523
- ], 8, uu)
2524
- ], 64))
2525
- ]))), 128)),
2526
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r("defs", {
2527
- key: `def_plot_${n}`
2528
- }, [
2529
- y("radialGradient", {
2530
- id: `plotGradient_${n}_${Y.value}`,
2531
- cx: "50%",
2532
- cy: "50%",
2533
- r: "50%",
2534
- fx: "50%",
2535
- fy: "50%"
2536
- }, [
2537
- y("stop", {
2538
- offset: "0%",
2539
- "stop-color": `${v(Dt)(e.color, 0.05)}`
2540
- }, null, 8, vu),
2541
- y("stop", {
2542
- offset: "100%",
2543
- "stop-color": e.color
2544
- }, null, 8, du)
2545
- ], 8, cu)
2546
- ]))), 128)),
2547
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r("defs", {
2548
- key: `def_line_${e.id}`
2549
- }, [
2550
- y("radialGradient", {
2551
- id: `lineGradient_${n}_${Y.value}`,
2552
- cx: "50%",
2553
- cy: "50%",
2554
- r: "50%",
2555
- fx: "50%",
2556
- fy: "50%"
2557
- }, [
2558
- y("stop", {
2559
- offset: "0%",
2560
- "stop-color": `${v(Dt)(e.color, 0.05)}`
2561
- }, null, 8, fu),
2562
- y("stop", {
2563
- offset: "100%",
2564
- "stop-color": e.color
2565
- }, null, 8, mu)
2566
- ], 8, hu),
2567
- l.$slots["area-gradient"] ? K(l.$slots, "area-gradient", Vt({
2568
- key: 0,
2569
- ref_for: !0
2570
- }, { series: e, id: `areaGradient_${n}_${Y.value}` }), void 0, !0) : (s(), r("linearGradient", {
2571
- key: 1,
2572
- id: `areaGradient_${n}_${Y.value}`,
2573
- x1: "0%",
2574
- x2: "100%",
2575
- y1: "0%",
2576
- y2: "0%"
2577
- }, [
2578
- y("stop", {
2579
- offset: "0%",
2580
- "stop-color": `${v(nt)(v(Dt)(e.color, 0.03), t.value.line.area.opacity)}`
2581
- }, null, 8, bu),
2582
- y("stop", {
2583
- offset: "100%",
2584
- "stop-color": `${v(nt)(e.color, t.value.line.area.opacity)}`
2585
- }, null, 8, xu)
2586
- ], 8, gu))
2587
- ]))), 128)),
2588
- (s(!0), r(b, null, C(_o.value, (e) => (s(), r("g", null, [
2589
- e.show ? (s(), r(b, { key: 0 }, [
2590
- (s(!0), r(b, null, C(e.span, (n, a) => (s(), r("g", null, [
2591
- y("rect", {
2592
- style: _({
2593
- transition: "none",
2594
- opacity: e.from + a >= p.value.start && e.from + a <= p.value.end - 1 ? 1 : 0
2595
- }),
2596
- x: c.value.left + c.value.width / T.value * (e.from + a - p.value.start),
2597
- y: c.value.top,
2598
- height: c.value.height < 0 ? 10 : c.value.height,
2599
- width: c.value.width / T.value < 0 ? 1e-5 : c.value.width / T.value,
2600
- fill: v(nt)(e.color, e.opacity)
2601
- }, null, 12, pu)
2602
- ]))), 256)),
2603
- (s(!0), r(b, null, C(e.span, (n, a) => (s(), r("g", null, [
2604
- e.caption.text && a === 0 ? (s(), r("foreignObject", {
2605
- key: 0,
2606
- x: c.value.left + c.value.width / T.value * (e.from + a - p.value.start) - (e.caption.width === "auto" ? 0 : e.caption.width / 2 - c.value.width / T.value * e.span / 2),
2607
- y: c.value.top + e.caption.offsetY,
2608
- style: _({
2609
- overflow: "visible",
2610
- opacity: e.to >= p.value.start && e.from < p.value.end ? 1 : 0
2611
- }),
2612
- height: "1",
2613
- width: e.caption.width === "auto" ? c.value.width / T.value * e.span : e.caption.width
2614
- }, [
2615
- y("div", {
2616
- style: _(`padding:${e.caption.padding}px;text-align:${e.caption.textAlign};font-size:${e.caption.fontSize}px;color:${e.caption.color};font-weight:${e.caption.bold ? "bold" : "normal"}`)
2617
- }, ne(e.caption.text), 5)
2618
- ], 12, yu)) : f("", !0)
2619
- ]))), 256))
2620
- ], 64)) : f("", !0)
2621
- ]))), 256)),
2622
- da.value ? (s(), r("g", ku, [
2623
- (s(!0), r(b, null, C(T.value, (e, n) => (s(), r("g", {
2624
- key: `tooltip_trap_highlighter_${n}`
2625
- }, [
2626
- y("rect", {
2627
- x: c.value.left + c.value.width / T.value * n,
2628
- y: c.value.top,
2629
- height: c.value.height < 0 ? 10 : c.value.height,
2630
- width: c.value.width / T.value < 0 ? 1e-5 : c.value.width / T.value,
2631
- fill: [O.value, L.value, ft.value].includes(n) ? v(nt)(t.value.chart.highlighter.color, t.value.chart.highlighter.opacity) : "transparent",
2632
- style: { transition: "none !important", animation: "none !important" }
2633
- }, null, 8, wu)
2634
- ]))), 128))
2635
- ])) : f("", !0),
2636
- yt.value.length ? (s(!0), r(b, { key: 1 }, C(yt.value, (e, n) => (s(), r("g", {
2637
- key: `serie_bar_${e.id}`,
2638
- class: Xe(`serie_bar_${n}`),
2639
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
2640
- }, [
2641
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r("g", {
2642
- key: `bar_plot_${n}_${i}`
2643
- }, [
2644
- Ve(a.value) ? (s(), r("rect", {
2645
- key: 0,
2646
- x: Il(a) + Fl.value / 2,
2647
- y: k.value.useIndividualScale ? Sa(a) : wa(a),
2648
- height: k.value.useIndividualScale ? Math.abs(ka(a)) : Math.abs(ya(a)),
2649
- width: Rl.value - Fl.value,
2650
- rx: t.value.bar.borderRadius,
2651
- fill: t.value.bar.useGradient ? a.value >= 0 ? `url(#rectGradient_pos_${n}_${Y.value})` : `url(#rectGradient_neg_${n}_${Y.value})` : e.color,
2652
- stroke: t.value.bar.border.useSerieColor ? e.color : t.value.bar.border.stroke,
2653
- "stroke-width": t.value.bar.border.strokeWidth,
2654
- style: _({
2655
- transition: v(oe) || !t.value.bar.showTransition ? void 0 : `all ${t.value.bar.transitionDurationMs}ms ease-in-out`
2656
- })
2657
- }, null, 12, Su)) : f("", !0),
2658
- Ve(a.value) && l.$slots.pattern ? (s(), r("rect", {
2659
- key: 1,
2660
- x: Il(a) - Fl.value / 2,
2661
- y: k.value.useIndividualScale ? Sa(a) : wa(a),
2662
- height: k.value.useIndividualScale ? Math.abs(ka(a)) : Math.abs(ya(a)),
2663
- width: Rl.value - Fl.value,
2664
- rx: t.value.bar.borderRadius,
2665
- fill: `url(#pattern_${Y.value}_${e.slotAbsoluteIndex})`,
2666
- stroke: t.value.bar.border.useSerieColor ? e.color : t.value.bar.border.stroke,
2667
- "stroke-width": t.value.bar.border.strokeWidth,
2668
- style: _({ transition: v(oe) || !t.value.bar.showTransition ? void 0 : `all ${t.value.bar.transitionDurationMs}ms ease-in-out` })
2669
- }, null, 12, _u)) : f("", !0),
2670
- a.comment && t.value.chart.comments.show ? (s(), r("foreignObject", {
2671
- key: 2,
2672
- style: { overflow: "visible" },
2673
- height: "12",
2674
- width: Rl.value / 2 + t.value.chart.comments.width,
2675
- x: Il(a) - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
2676
- y: v(W)(a.y) + t.value.chart.comments.offsetY + 6
2677
- }, [
2678
- K(l.$slots, "plot-comment", {
2679
- plot: { ...a, color: e.color, seriesIndex: n, datapointIndex: i }
2680
- }, void 0, !0)
2681
- ], 8, $u)) : f("", !0)
2682
- ]))), 128)),
2683
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(le)(e.plots).trend) ? (s(), r("g", Lu, [
2684
- y("defs", null, [
2685
- y("marker", {
2686
- id: `bar_arrow_${n}`,
2687
- markerWidth: 7,
2688
- markerHeight: 7,
2689
- refX: "0",
2690
- refY: 7 / 2,
2691
- orient: "auto"
2692
- }, [
2693
- y("polygon", {
2694
- points: `0 0, 7 ${7 / 2}, 0 7`,
2695
- fill: e.color
2696
- }, null, 8, Cu)
2697
- ], 8, Mu)
2698
- ]),
2699
- e.plots.length > 1 ? (s(), r("line", {
2700
- key: 0,
2701
- x1: v(le)(e.plots).x1 + al(),
2702
- x2: v(le)(e.plots).x2 + al(),
2703
- y1: v(Z)(v(le)(e.plots).y1),
2704
- y2: v(Z)(v(le)(e.plots).y2),
2705
- "stroke-width": 1,
2706
- stroke: e.color,
2707
- "stroke-dasharray": 2,
2708
- "marker-end": `url(#bar_arrow_${n})`
2709
- }, null, 8, Au)) : f("", !0),
2710
- e.plots.length > 1 ? (s(), r("text", {
2711
- key: 1,
2712
- "text-anchor": "middle",
2713
- x: v(le)(e.plots).x2 + al(),
2714
- y: v(le)(e.plots).y2 - 6,
2715
- "font-size": w.value.plotLabels,
2716
- fill: e.color
2717
- }, ne(v(Qe)({
2718
- v: v(le)(e.plots).trend * 100,
2719
- s: "%",
2720
- r: 2
2721
- })), 9, zu)) : f("", !0)
2722
- ])) : f("", !0)
2723
- ], 6))), 128)) : f("", !0),
2724
- !k.value.useIndividualScale && t.value.chart.grid.labels.zeroLine.show ? (s(), r("line", {
2725
- key: 2,
2726
- stroke: t.value.chart.grid.stroke,
2727
- "stroke-width": "1",
2728
- x1: c.value.left + te.value,
2729
- x2: c.value.right,
2730
- y1: v(Z)(Ie.value),
2731
- y2: v(Z)(Ie.value),
2732
- "stroke-linecap": "round",
2733
- style: { animation: "none !important" }
2734
- }, null, 8, Tu)) : f("", !0),
2735
- t.value.chart.highlighter.useLine && (![null, void 0].includes(L.value) || ![null, void 0].includes(O.value)) ? (s(), r("g", Iu, [
2736
- y("line", {
2737
- x1: c.value.left + c.value.width / T.value * ((L.value !== null ? L.value : 0) || (O.value !== null ? O.value : 0)) + c.value.width / T.value / 2,
2738
- x2: c.value.left + c.value.width / T.value * ((L.value !== null ? L.value : 0) || (O.value !== null ? O.value : 0)) + c.value.width / T.value / 2,
2739
- y1: v(Z)(c.value.top),
2740
- y2: v(Z)(c.value.bottom),
2741
- stroke: t.value.chart.highlighter.color,
2742
- "stroke-width": t.value.chart.highlighter.lineWidth,
2743
- "stroke-dasharray": t.value.chart.highlighter.lineDasharray,
2744
- "stroke-linecap": "round",
2745
- style: { transition: "none !important", animation: "none !important", "pointer-events": "none" }
2746
- }, null, 8, Nu)
2747
- ])) : f("", !0),
2748
- t.value.chart.grid.frame.show ? (s(), r("rect", {
2749
- key: 4,
2750
- style: { pointerEvents: "none", transition: "none", animation: "none !important" },
2751
- x: c.value.left + te.value < 0 ? 0 : c.value.left + te.value,
2752
- y: c.value.top,
2753
- width: c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / T.value) < 0 ? 0 : c.value.width - (t.value.chart.grid.position === "middle" ? 0 : c.value.width / T.value),
2754
- height: c.value.height < 0 ? 0 : c.value.height,
2755
- fill: "transparent",
2756
- stroke: t.value.chart.grid.frame.stroke,
2757
- "stroke-width": t.value.chart.grid.frame.strokeWidth,
2758
- "stroke-linecap": t.value.chart.grid.frame.strokeLinecap,
2759
- "stroke-linejoin": t.value.chart.grid.frame.strokeLinejoin,
2760
- "stroke-dasharray": t.value.chart.grid.frame.strokeDasharray
2761
- }, null, 8, Ru)) : f("", !0),
2762
- t.value.chart.grid.labels.show ? (s(), r("g", {
2763
- key: 5,
2764
- ref_key: "scaleLabels",
2765
- ref: Rt
2766
- }, [
2767
- k.value.useIndividualScale ? (s(), r(b, { key: 0 }, [
2768
- (s(!0), r(b, null, C(Sl.value, (e) => (s(), r("g", null, [
2769
- y("line", {
2770
- x1: e.x + te.value - c.value.individualOffsetX,
2771
- x2: e.x + te.value - c.value.individualOffsetX,
2772
- y1: k.value.isStacked ? v(Z)(c.value.bottom - e.yOffset - e.individualHeight) : v(Z)(c.value.top),
2773
- y2: k.value.isStacked ? v(Z)(c.value.bottom - e.yOffset) : v(Z)(c.value.bottom),
2774
- stroke: e.color,
2775
- "stroke-width": t.value.chart.grid.stroke,
2776
- "stroke-linecap": "round",
2777
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out; animation: none !important`)
2778
- }, null, 12, Fu)
2779
- ]))), 256)),
2780
- (s(!0), r(b, null, C(Sl.value, (e) => (s(), r("g", {
2781
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out`)
2782
- }, [
2783
- y("text", {
2784
- fill: e.color,
2785
- "font-size": w.value.dataLabels * 0.8,
2786
- "text-anchor": "middle",
2787
- transform: `translate(${e.x - w.value.dataLabels * 0.8 / 2 + te.value}, ${k.value.isStacked ? c.value.bottom - e.yOffset - e.individualHeight / 2 : c.value.top + c.value.height / 2}) rotate(-90)`
2788
- }, ne(e.name) + " " + ne(e.scaleLabel && e.unique && e.scaleLabel !== e.id ? `-
2789
- ${e.scaleLabel}` : ""), 9, Pu),
2790
- (s(!0), r(b, null, C(e.yLabels, (n, a) => (s(), r(b, null, [
2791
- t.value.chart.grid.labels.yAxis.showCrosshairs ? (s(), r("line", {
2792
- key: 0,
2793
- x1: e.x + 3 + te.value - t.value.chart.grid.labels.yAxis.crosshairSize - c.value.individualOffsetX,
2794
- x2: e.x + te.value - c.value.individualOffsetX,
2795
- y1: v(Z)(n.y),
2796
- y2: v(Z)(n.y),
2797
- stroke: e.color,
2798
- "stroke-width": 1,
2799
- "stroke-linecap": "round",
2800
- style: { animation: "none !important" }
2801
- }, null, 8, Ou)) : f("", !0)
2802
- ], 64))), 256)),
2803
- (s(!0), r(b, null, C(e.yLabels, (n, a) => (s(), r("text", {
2804
- x: e.x - 5 + te.value - c.value.individualOffsetX,
2805
- y: v(Z)(n.y) + w.value.dataLabels / 3,
2806
- "font-size": w.value.dataLabels,
2807
- "text-anchor": "end",
2808
- fill: e.color
2809
- }, ne(v(Le)(
2810
- t.value.chart.grid.labels.yAxis.formatter,
2811
- n.value,
2812
- v(Qe)({
2813
- p: n.prefix,
2814
- v: n.value,
2815
- s: n.suffix,
2816
- r: t.value.chart.grid.labels.yAxis.rounding
2817
- }),
2818
- { datapoint: n.datapoint, seriesIndex: a }
2819
- )), 9, Bu))), 256))
2820
- ], 4))), 256))
2821
- ], 64)) : (s(!0), r(b, { key: 1 }, C(Ma.value, (e, n) => (s(), r("g", {
2822
- key: `yLabel_${n}`
2823
- }, [
2824
- Ve(e) && e.value >= Te.value.min && e.value <= Te.value.max && t.value.chart.grid.labels.yAxis.showCrosshairs ? (s(), r("line", {
2825
- key: 0,
2826
- x1: c.value.left + te.value,
2827
- x2: c.value.left + te.value - t.value.chart.grid.labels.yAxis.crosshairSize,
2828
- y1: v(Z)(e.y),
2829
- y2: v(Z)(e.y),
2830
- stroke: t.value.chart.grid.stroke,
2831
- "stroke-width": "1",
2832
- "stroke-linecap": "round",
2833
- style: { animation: "none !important" }
2834
- }, null, 8, Hu)) : f("", !0),
2835
- e.value >= Te.value.min && e.value <= Te.value.max ? (s(), r("text", {
2836
- key: 1,
2837
- x: c.value.scaleLabelX - t.value.chart.grid.labels.yAxis.crosshairSize,
2838
- y: v(W)(e.y + w.value.dataLabels / 3),
2839
- "font-size": w.value.dataLabels,
2840
- "text-anchor": "end",
2841
- fill: t.value.chart.grid.labels.color
2842
- }, ne(Ve(e.value) ? v(Le)(
2843
- t.value.chart.grid.labels.yAxis.formatter,
2844
- e.value,
2845
- v(Qe)({
2846
- p: e.prefix,
2847
- v: e.value,
2848
- s: e.suffix,
2849
- r: t.value.chart.grid.labels.yAxis.rounding
2850
- })
2851
- ) : ""), 9, Vu)) : f("", !0)
2852
- ]))), 128))
2853
- ], 512)) : f("", !0),
2854
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r("g", {
2855
- key: `serie_plot_${e.id}`,
2856
- class: Xe(`serie_plot_${n}`),
2857
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
2858
- }, [
2859
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r("g", {
2860
- key: `circle_plot_${n}_${i}`
2861
- }, [
2862
- a && Ve(a.value) ? (s(), Je(El, {
2863
- key: 0,
2864
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
2865
- color: t.value.plot.useGradient ? `url(#plotGradient_${n}_${Y.value})` : t.value.plot.dot.useSerieColor ? e.color : t.value.plot.dot.fill,
2866
- plot: { x: v(W)(a.x), y: v(W)(a.y) },
2867
- radius: L.value !== null && L.value === i || O.value !== null && O.value === i ? (Fe.value.plot || 6) * 1.5 : Fe.value.plot || 6,
2868
- stroke: t.value.plot.dot.useSerieColor ? t.value.chart.backgroundColor : e.color,
2869
- strokeWidth: t.value.plot.dot.strokeWidth,
2870
- transition: v(oe) || !t.value.plot.showTransition || L.value !== null && L.value === i || O.value !== null && O.value === i ? void 0 : `all ${t.value.plot.transitionDurationMs}ms ease-in-out`
2871
- }, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth", "transition"])) : f("", !0),
2872
- a.comment && t.value.chart.comments.show ? (s(), r("foreignObject", {
2873
- key: 1,
2874
- style: { overflow: "visible" },
2875
- height: "12",
2876
- width: t.value.chart.comments.width,
2877
- x: a.x - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
2878
- y: a.y + t.value.chart.comments.offsetY + 6
2879
- }, [
2880
- y("div", Du, [
2881
- K(l.$slots, "plot-comment", {
2882
- plot: { ...a, color: e.color, seriesIndex: n, datapointIndex: i }
2883
- }, void 0, !0)
2884
- ])
2885
- ], 8, Eu)) : f("", !0)
2886
- ]))), 128)),
2887
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(le)(e.plots).trend) ? (s(), r("g", Wu, [
2888
- y("defs", null, [
2889
- y("marker", {
2890
- id: `plot_arrow_${n}`,
2891
- markerWidth: 7,
2892
- markerHeight: 7,
2893
- refX: "0",
2894
- refY: 7 / 2,
2895
- orient: "auto"
2896
- }, [
2897
- y("polygon", {
2898
- points: `0 0, 7 ${7 / 2}, 0 7`,
2899
- fill: e.color
2900
- }, null, 8, Yu)
2901
- ], 8, Xu)
2902
- ]),
2903
- e.plots.length > 1 ? (s(), r("line", {
2904
- key: 0,
2905
- x1: v(le)(e.plots).x1,
2906
- x2: v(le)(e.plots).x2,
2907
- y1: v(Z)(v(le)(e.plots).y1),
2908
- y2: v(Z)(v(le)(e.plots).y2),
2909
- "stroke-width": 1,
2910
- stroke: e.color,
2911
- "stroke-dasharray": 2,
2912
- "marker-end": `url(#plot_arrow_${n})`
2913
- }, null, 8, Gu)) : f("", !0),
2914
- e.plots.length > 1 ? (s(), r("text", {
2915
- key: 1,
2916
- "text-anchor": "middle",
2917
- x: v(le)(e.plots).x2,
2918
- y: v(le)(e.plots).y2 - 6,
2919
- "font-size": w.value.plotLabels,
2920
- fill: e.color
2921
- }, ne(v(Qe)({
2922
- v: v(le)(e.plots).trend * 100,
2923
- s: "%",
2924
- r: 2
2925
- })), 9, Uu)) : f("", !0)
2926
- ])) : f("", !0)
2927
- ], 6))), 128)),
2928
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r("g", {
2929
- key: `serie_line_${e.id}`,
2930
- class: Xe(`serie_line_${n}`),
2931
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
2932
- }, [
2933
- e.smooth && e.plots.length > 1 && e.curve ? (s(), r("path", {
2934
- key: 0,
2935
- d: `M${e.curve}`,
2936
- stroke: t.value.chart.backgroundColor,
2937
- "stroke-width": t.value.line.strokeWidth + 1,
2938
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
2939
- fill: "none",
2940
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2941
- }, null, 12, qu)) : e.plots.length > 1 && e.straight ? (s(), r("path", {
2942
- key: 1,
2943
- d: `M${e.straight}`,
2944
- stroke: t.value.chart.backgroundColor,
2945
- "stroke-width": t.value.line.strokeWidth + 1,
2946
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
2947
- fill: "none",
2948
- "stroke-linecap": "round",
2949
- "stroke-linejoin": "round",
2950
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2951
- }, null, 12, Zu)) : f("", !0)
2952
- ], 6))), 128)),
2953
- l.$slots.pattern ? (s(), r("defs", Ku, [
2954
- (s(!0), r(b, null, C(at.value, (e, n) => K(l.$slots, "pattern", Vt({
2955
- key: `serie_pattern_slot_${e.id}`
2956
- }, { ref_for: !0 }, { ...e, seriesIndex: e.slotAbsoluteIndex, patternId: `pattern_${Y.value}_${n}` }), void 0, !0)), 128))
2957
- ])) : f("", !0),
2958
- za.value.length && !k.value.isStacked ? (s(), r("g", Ju, [
2959
- (s(!0), r(b, null, C(za.value, (e) => (s(), r("path", {
2960
- key: e.key,
2961
- d: e.d,
2962
- fill: e.color,
2963
- "fill-opacity": t.value.line.interLine.fillOpacity,
2964
- stroke: "none",
2965
- "pointer-events": "none",
2966
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2967
- }, null, 12, Qu))), 128))
2968
- ])) : f("", !0),
2969
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r("g", {
2970
- key: `serie_line_above_${e.id}`,
2971
- class: Xe(`serie_line_${n}`),
2972
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
2973
- }, [
2974
- e.useArea && e.plots.length > 1 ? (s(), r("g", ju, [
2975
- e.smooth ? (s(!0), r(b, { key: 0 }, C(e.curveAreas, (a, i) => (s(), r(b, { key: i }, [
2976
- a ? (s(), r("path", {
2977
- key: 0,
2978
- d: a,
2979
- fill: t.value.line.area.useGradient ? `url(#areaGradient_${n}_${Y.value})` : v(nt)(e.color, t.value.line.area.opacity),
2980
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2981
- }, null, 12, ei)) : f("", !0),
2982
- l.$slots.pattern && a ? (s(), r("path", {
2983
- key: 1,
2984
- d: a,
2985
- fill: `url(#pattern_${Y.value}_${e.slotAbsoluteIndex})`,
2986
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2987
- }, null, 12, ti)) : f("", !0)
2988
- ], 64))), 128)) : (s(!0), r(b, { key: 1 }, C(e.area.split(";"), (a, i) => (s(), r(b, { key: i }, [
2989
- a ? (s(), r("path", {
2990
- key: 0,
2991
- d: `M${a}Z`,
2992
- fill: t.value.line.area.useGradient ? `url(#areaGradient_${n}_${Y.value})` : v(nt)(e.color, t.value.line.area.opacity),
2993
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
2994
- }, null, 12, li)) : f("", !0),
2995
- l.$slots.pattern && a ? (s(), r("path", {
2996
- key: 1,
2997
- d: `M${a}Z`,
2998
- fill: `url(#pattern_${Y.value}_${e.slotAbsoluteIndex})`,
2999
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3000
- }, null, 12, ai)) : f("", !0)
3001
- ], 64))), 128))
3002
- ])) : f("", !0),
3003
- e.smooth && e.plots.length > 1 && e.curve ? (s(), r("path", {
3004
- key: 1,
3005
- d: `M${e.curve}`,
3006
- stroke: e.color,
3007
- "stroke-width": t.value.line.strokeWidth,
3008
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3009
- fill: "none",
3010
- "stroke-linecap": "round",
3011
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3012
- }, null, 12, oi)) : e.plots.length > 1 && e.straight ? (s(), r("path", {
3013
- key: 2,
3014
- d: `M${e.straight}`,
3015
- stroke: e.color,
3016
- "stroke-width": t.value.line.strokeWidth,
3017
- "stroke-dasharray": e.dashed ? t.value.line.strokeWidth * 2 : 0,
3018
- fill: "none",
3019
- "stroke-linecap": "round",
3020
- "stroke-linejoin": "round",
3021
- style: _({ transition: v(oe) || !t.value.line.showTransition ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out` })
3022
- }, null, 12, ni)) : f("", !0),
3023
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3024
- key: `circle_line_${n}_${i}`
3025
- }, [
3026
- !$a.value.linePlot && a && Ve(a.value) || $a.value.linePlot && a && Ve(a.value) && (L.value !== null && L.value === i || O.value !== null && O.value === i) || Aa(e.plots, i) ? (s(), Je(El, {
3027
- key: 0,
3028
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
3029
- color: t.value.line.useGradient ? `url(#lineGradient_${n}_${Y.value})` : t.value.line.dot.useSerieColor ? e.color : t.value.line.dot.fill,
3030
- plot: { x: v(W)(a.x), y: v(W)(a.y) },
3031
- radius: L.value !== null && L.value === i || O.value !== null && O.value === i ? (Fe.value.line || 6) * 1.5 : (Aa(e.plots, i), Fe.value.line || 6),
3032
- stroke: t.value.line.dot.useSerieColor ? t.value.chart.backgroundColor : e.color,
3033
- strokeWidth: t.value.line.dot.strokeWidth,
3034
- transition: v(oe) || !t.value.line.showTransition || L.value !== null && L.value === i || O.value !== null && O.value === i ? void 0 : `all ${t.value.line.transitionDurationMs}ms ease-in-out`
3035
- }, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth", "transition"])) : f("", !0),
3036
- a.comment && t.value.chart.comments.show ? (s(), r("foreignObject", {
3037
- key: 1,
3038
- style: { overflow: "visible" },
3039
- height: "12",
3040
- width: t.value.chart.comments.width,
3041
- x: a.x - t.value.chart.comments.width / 2 + t.value.chart.comments.offsetX,
3042
- y: a.y + t.value.chart.comments.offsetY + 6
3043
- }, [
3044
- y("div", ii, [
3045
- K(l.$slots, "plot-comment", {
3046
- plot: { ...a, color: e.color, seriesIndex: n, datapointIndex: i }
3047
- }, void 0, !0)
3048
- ])
3049
- ], 8, ui)) : f("", !0)
3050
- ], 64))), 128)),
3051
- Object.hasOwn(e, "useProgression") && e.useProgression === !0 && !isNaN(v(le)(e.plots).trend) ? (s(), r("g", si, [
3052
- y("defs", null, [
3053
- y("marker", {
3054
- id: `line_arrow_${n}`,
3055
- markerWidth: 7,
3056
- markerHeight: 7,
3057
- refX: "0",
3058
- refY: 7 / 2,
3059
- orient: "auto"
3060
- }, [
3061
- y("polygon", {
3062
- points: `0 0, 7 ${7 / 2}, 0 7`,
3063
- fill: e.color
3064
- }, null, 8, ci)
3065
- ], 8, ri)
3066
- ]),
3067
- e.plots.length > 1 ? (s(), r("line", {
3068
- key: 0,
3069
- x1: v(le)(e.plots).x1,
3070
- x2: v(le)(e.plots).x2,
3071
- y1: v(Z)(v(le)(e.plots).y1),
3072
- y2: v(Z)(v(le)(e.plots).y2),
3073
- "stroke-width": 1,
3074
- stroke: e.color,
3075
- "stroke-dasharray": 2,
3076
- "marker-end": `url(#line_arrow_${n})`
3077
- }, null, 8, vi)) : f("", !0),
3078
- e.plots.length > 1 ? (s(), r("text", {
3079
- key: 1,
3080
- "text-anchor": "middle",
3081
- x: v(le)(e.plots).x2,
3082
- y: v(le)(e.plots).y2 - 6,
3083
- "font-size": w.value.plotLabels,
3084
- fill: e.color
3085
- }, ne(v(Qe)({
3086
- v: v(le)(e.plots).trend * 100,
3087
- s: "%",
3088
- r: 2
3089
- })), 9, di)) : f("", !0)
3090
- ])) : f("", !0)
3091
- ], 6))), 128)),
3092
- (t.value.bar.labels.show || t.value.bar.serieName.show) && k.value.dataLabels.show ? (s(), r("g", hi, [
3093
- (s(!0), r(b, null, C(yt.value, (e, n) => (s(), r(b, {
3094
- key: `xLabel_bar_${e.id}`
3095
- }, [
3096
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3097
- key: `xLabel_bar_${n}_${i}`
3098
- }, [
3099
- a && (!Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || L.value !== null && L.value === i || O.value !== null && O.value === i) && t.value.bar.labels.show ? (s(), r("text", {
3100
- key: 0,
3101
- x: k.value.useIndividualScale && k.value.isStacked ? a.x + se.value.line / 2 : Il(a) + al() / 2 - Nl.value / 2,
3102
- y: v(W)(a.y) + (a.value >= 0 ? t.value.bar.labels.offsetY : -t.value.bar.labels.offsetY * 3),
3103
- "text-anchor": "middle",
3104
- "font-size": w.value.plotLabels,
3105
- fill: t.value.bar.labels.color,
3106
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3107
- }, ne(Ve(a.value) ? v(Le)(
3108
- t.value.bar.labels.formatter,
3109
- a.value,
3110
- v(Qe)({
3111
- p: e.prefix || t.value.chart.labels.prefix,
3112
- v: a.value,
3113
- s: e.suffix || t.value.chart.labels.suffix,
3114
- r: t.value.bar.labels.rounding
3115
- }),
3116
- {
3117
- datapoint: a,
3118
- serie: e
3119
- }
3120
- ) : ""), 13, fi)) : f("", !0),
3121
- a && t.value.bar.serieName.show ? (s(), r("text", {
3122
- key: 1,
3123
- x: k.value.useIndividualScale && k.value.isStacked ? a.x + se.value.line / 2 : a.x + al() * 1.1,
3124
- y: a.y + (a.value > 0 ? t.value.bar.serieName.offsetY : -t.value.bar.serieName.offsetY * 3),
3125
- "text-anchor": "middle",
3126
- "font-size": w.value.plotLabels,
3127
- fill: t.value.bar.serieName.useSerieColor ? e.color : t.value.bar.serieName.color,
3128
- "font-weight": t.value.bar.serieName.bold ? "bold" : "normal",
3129
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3130
- }, ne(t.value.bar.serieName.useAbbreviation ? v(jo)({
3131
- source: e.name,
3132
- length: t.value.bar.serieName.abbreviationSize
3133
- }) : e.name), 13, mi)) : f("", !0)
3134
- ], 64))), 128))
3135
- ], 64))), 128))
3136
- ])) : f("", !0),
3137
- t.value.plot.labels.show && k.value.dataLabels.show ? (s(), r("g", gi, [
3138
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r(b, {
3139
- key: `xLabel_plot_${e.id}`
3140
- }, [
3141
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3142
- key: `xLabel_plot_${n}_${i}`
3143
- }, [
3144
- a && !Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || L.value !== null && L.value === i || O.value !== null && O.value === i ? (s(), r("text", {
3145
- key: 0,
3146
- x: a.x,
3147
- y: a.y + t.value.plot.labels.offsetY,
3148
- "text-anchor": "middle",
3149
- "font-size": w.value.plotLabels,
3150
- fill: t.value.plot.labels.color,
3151
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3152
- }, ne(Ve(a.value) ? v(Le)(
3153
- t.value.plot.labels.formatter,
3154
- a.value,
3155
- v(Qe)({
3156
- p: e.prefix || t.value.chart.labels.prefix,
3157
- v: a.value,
3158
- s: e.suffix || t.value.chart.labels.suffix,
3159
- r: t.value.plot.labels.rounding
3160
- }),
3161
- {
3162
- datapoint: a,
3163
- serie: e
3164
- }
3165
- ) : ""), 13, bi)) : f("", !0)
3166
- ], 64))), 128))
3167
- ], 64))), 128))
3168
- ])) : (s(), r("g", xi, [
3169
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r(b, {
3170
- key: `xLabel_plot_${e.id}`
3171
- }, [
3172
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3173
- key: `xLabel_plot_${n}_${i}`
3174
- }, [
3175
- t.value.plot.tag.followValue ? (s(), r(b, { key: 1 }, [
3176
- [O.value, L.value, ft.value].includes(i) && e.useTag ? (s(), r("line", {
3177
- key: 0,
3178
- class: "vue-ui-xy-tag-plot",
3179
- x1: c.value.left,
3180
- x2: c.value.right,
3181
- y1: a.y,
3182
- y2: a.y,
3183
- "stroke-width": 1,
3184
- "stroke-linecap": "round",
3185
- "stroke-dasharray": "2",
3186
- stroke: e.color
3187
- }, null, 8, Si)) : f("", !0)
3188
- ], 64)) : (s(), r(b, { key: 0 }, [
3189
- a && i === 0 && e.useTag && e.useTag === "start" ? (s(), r("foreignObject", {
3190
- key: 0,
3191
- x: a.x,
3192
- y: a.y - 20,
3193
- height: 24,
3194
- width: "150",
3195
- style: _(`overflow: visible; opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3196
- }, [
3197
- y("div", {
3198
- style: _(`padding: 3px; background:${v(nt)(e.color, 80)};color:${v(ut)(e.color)};width:fit-content;font-size:${w.value.plotLabels}px;border-radius: 2px;`),
3199
- innerHTML: v(Le)(
3200
- t.value.plot.tag.formatter,
3201
- a.value,
3202
- e.name,
3203
- {
3204
- datapoint: a,
3205
- seriesIndex: i,
3206
- serieName: e.name
3207
- }
3208
- )
3209
- }, null, 12, yi)
3210
- ], 12, pi)) : f("", !0),
3211
- a && i === e.plots.length - 1 && e.useTag && e.useTag === "end" ? (s(), r("foreignObject", {
3212
- key: 1,
3213
- x: a.x - e.name.length * (w.value.plotLabels / 2),
3214
- y: a.y - 20,
3215
- height: 24,
3216
- width: "150",
3217
- style: _(`overflow: visible; opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3218
- }, [
3219
- y("div", {
3220
- style: _(`padding: 3px; background:${v(nt)(e.color, 80)};color:${v(ut)(e.color)};width:fit-content;font-size:${w.value.plotLabels}px;border-radius: 2px;`),
3221
- innerHTML: v(Le)(
3222
- t.value.plot.tag.formatter,
3223
- a.value,
3224
- e.name,
3225
- {
3226
- datapoint: a,
3227
- seriesIndex: i,
3228
- serieName: e.name
3229
- }
3230
- )
3231
- }, null, 12, wi)
3232
- ], 12, ki)) : f("", !0)
3233
- ], 64))
3234
- ], 64))), 128))
3235
- ], 64))), 128))
3236
- ])),
3237
- t.value.line.labels.show && k.value.dataLabels.show ? (s(), r("g", _i, [
3238
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r(b, {
3239
- key: `xLabel_line_${e.id}`
3240
- }, [
3241
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3242
- key: `xLabel_line_${n}_${i}`
3243
- }, [
3244
- a && !Object.hasOwn(e, "dataLabels") || e.dataLabels === !0 || L.value !== null && L.value === i || O.value !== null && O.value === i ? (s(), r("text", {
3245
- key: 0,
3246
- x: a.x,
3247
- y: a.y + (a.value >= 0 ? t.value.line.labels.offsetY : -t.value.line.labels.offsetY * 3),
3248
- "text-anchor": "middle",
3249
- "font-size": w.value.plotLabels,
3250
- fill: t.value.line.labels.color,
3251
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3252
- }, ne(Ve(a.value) ? v(Le)(
3253
- t.value.line.labels.formatter,
3254
- a.value,
3255
- v(Qe)({
3256
- p: e.prefix || t.value.chart.labels.prefix,
3257
- v: a.value,
3258
- s: e.suffix || t.value.chart.labels.suffix,
3259
- r: t.value.line.labels.rounding
3260
- }),
3261
- {
3262
- datapoint: a,
3263
- serie: e
3264
- }
3265
- ) : ""), 13, $i)) : f("", !0)
3266
- ], 64))), 128))
3267
- ], 64))), 128))
3268
- ])) : (s(), r("g", Li, [
3269
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r(b, {
3270
- key: `xLabel_line_${e.id}`
3271
- }, [
3272
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3273
- key: `xLabel_line_${n}_${i}`
3274
- }, [
3275
- t.value.line.tag.followValue ? (s(), r(b, { key: 1 }, [
3276
- [O.value, L.value, ft.value].includes(i) && e.useTag ? (s(), r("line", {
3277
- key: 0,
3278
- class: "vue-ui-xy-tag-line",
3279
- x1: c.value.left,
3280
- x2: c.value.right,
3281
- y1: a.y,
3282
- y2: a.y,
3283
- "stroke-width": 1,
3284
- "stroke-linecap": "round",
3285
- "stroke-dasharray": "2",
3286
- stroke: e.color
3287
- }, null, 8, Ti)) : f("", !0)
3288
- ], 64)) : (s(), r(b, { key: 0 }, [
3289
- a && i === 0 && e.useTag && e.useTag === "start" ? (s(), r("foreignObject", {
3290
- key: 0,
3291
- x: a.x,
3292
- y: a.y - 20,
3293
- height: 24,
3294
- width: "150",
3295
- style: _(`overflow: visible; opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3296
- }, [
3297
- y("div", {
3298
- style: _(`padding: 3px; background:${v(nt)(e.color, 80)};color:${v(ut)(e.color)};width:fit-content;font-size:${w.value.plotLabels}px;border-radius: 2px;`),
3299
- innerHTML: v(Le)(
3300
- t.value.line.tag.formatter,
3301
- a.value,
3302
- e.name,
3303
- {
3304
- datapoint: a,
3305
- seriesIndex: i,
3306
- serieName: e.name
3307
- }
3308
- )
3309
- }, null, 12, Ci)
3310
- ], 12, Mi)) : f("", !0),
3311
- a && i === e.plots.length - 1 && e.useTag && e.useTag === "end" ? (s(), r("foreignObject", {
3312
- key: 1,
3313
- x: a.x,
3314
- y: a.y - 20,
3315
- height: 24,
3316
- width: "150",
3317
- style: _(`overflow: visible; opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3318
- }, [
3319
- y("div", {
3320
- style: _(`padding: 3px; background:${v(nt)(e.color, 80)};color:${v(ut)(e.color)};width:fit-content;font-size:${w.value.plotLabels}px;border-radius: 2px;`),
3321
- innerHTML: v(Le)(
3322
- t.value.line.tag.formatter,
3323
- a.value,
3324
- e.name,
3325
- {
3326
- datapoint: a,
3327
- seriesIndex: i,
3328
- serieName: e.name
3329
- }
3330
- )
3331
- }, null, 12, zi)
3332
- ], 12, Ai)) : f("", !0)
3333
- ], 64))
3334
- ], 64))), 128))
3335
- ], 64))), 128))
3336
- ])),
3337
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r(b, {
3338
- key: `xLabel_line_${e.id}`
3339
- }, [
3340
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3341
- key: `xLabel_line_${n}_${i}`
3342
- }, [
3343
- a && i === 0 && e.showSerieName && e.showSerieName === "start" ? (s(), r("text", {
3344
- key: 0,
3345
- x: a.x - w.value.plotLabels,
3346
- y: a.y,
3347
- "font-size": w.value.plotLabels,
3348
- "text-anchor": "end",
3349
- fill: e.color,
3350
- innerHTML: v(Vl)({
3351
- content: e.name,
3352
- fontSize: w.value.plotLabels,
3353
- fill: e.color,
3354
- x: a.x - w.value.plotLabels,
3355
- y: a.y,
3356
- maxWords: 2
3357
- }),
3358
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3359
- }, null, 12, Ii)) : f("", !0),
3360
- a && i === e.plots.length - 1 && e.showSerieName && e.showSerieName === "end" ? (s(), r("text", {
3361
- key: 1,
3362
- x: a.x + w.value.plotLabels,
3363
- y: a.y,
3364
- "font-size": w.value.plotLabels,
3365
- "text-anchor": "start",
3366
- fill: e.color,
3367
- innerHTML: v(Vl)({
3368
- content: e.name,
3369
- fontSize: w.value.plotLabels,
3370
- fill: e.color,
3371
- x: a.x + w.value.plotLabels,
3372
- y: a.y,
3373
- maxWords: 2
3374
- }),
3375
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3376
- }, null, 12, Ni)) : f("", !0)
3377
- ], 64))), 128))
3378
- ], 64))), 128)),
3379
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r(b, {
3380
- key: `xLabel_plot_${e.id}`
3381
- }, [
3382
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3383
- key: `xLabel_plot_${n}_${i}`
3384
- }, [
3385
- a && i === 0 && e.showSerieName && e.showSerieName === "start" ? (s(), r("text", {
3386
- key: 0,
3387
- x: a.x - w.value.plotLabels,
3388
- y: a.y,
3389
- "font-size": w.value.plotLabels,
3390
- "text-anchor": "end",
3391
- fill: e.color,
3392
- innerHTML: v(Vl)({
3393
- content: e.name,
3394
- fontSize: w.value.plotLabels,
3395
- fill: e.color,
3396
- x: a.x - w.value.plotLabels,
3397
- y: a.y,
3398
- maxWords: 2
3399
- }),
3400
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3401
- }, null, 12, Ri)) : f("", !0),
3402
- a && i === e.plots.length - 1 && e.showSerieName && e.showSerieName === "end" ? (s(), r("text", {
3403
- key: 1,
3404
- x: a.x + w.value.plotLabels,
3405
- y: a.y,
3406
- "font-size": w.value.plotLabels,
3407
- "text-anchor": "start",
3408
- fill: e.color,
3409
- innerHTML: v(Vl)({
3410
- content: e.name,
3411
- fontSize: w.value.plotLabels,
3412
- fill: e.color,
3413
- x: a.x + w.value.plotLabels,
3414
- y: a.y,
3415
- maxWords: 2
3416
- }),
3417
- style: _(`opacity:${P.value ? P.value === e.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
3418
- }, null, 12, Fi)) : f("", !0)
3419
- ], 64))), 128))
3420
- ], 64))), 128)),
3421
- k.value.useIndividualScale && !k.value.isStacked ? (s(), r(b, { key: 13 }, [
3422
- y("defs", null, [
3423
- (s(!0), r(b, null, C(Sl.value, (e, n) => (s(), r("linearGradient", {
3424
- id: `individual_scale_gradient_${Y.value}_${n}`,
3425
- x1: "0%",
3426
- x2: "100%",
3427
- y1: "0%",
3428
- y2: "0%"
3429
- }, [
3430
- y("stop", {
3431
- offset: "0%",
3432
- "stop-color": t.value.chart.backgroundColor,
3433
- "stop-opacity": "0"
3434
- }, null, 8, Oi),
3435
- y("stop", {
3436
- offset: "100%",
3437
- "stop-color": e.color,
3438
- "stop-opacity": "0.2"
3439
- }, null, 8, Bi)
3440
- ], 8, Pi))), 256))
3441
- ]),
3442
- (s(!0), r(b, null, C(Sl.value, (e, n) => (s(), r("rect", {
3443
- x: e.x - t.value.chart.grid.labels.yAxis.labelWidth + te.value - c.value.individualOffsetX,
3444
- y: c.value.top,
3445
- width: t.value.chart.grid.labels.yAxis.labelWidth + c.value.individualOffsetX,
3446
- height: c.value.height < 0 ? 10 : c.value.height,
3447
- fill: P.value === e.groupId ? `url(#individual_scale_gradient_${Y.value}_${n})` : "transparent",
3448
- onMouseenter: (a) => P.value = e.groupId,
3449
- onMouseleave: u[0] || (u[0] = (a) => P.value = null)
3450
- }, null, 40, Hi))), 256))
3451
- ], 64)) : f("", !0),
3452
- y("g", null, [
3453
- t.value.chart.grid.labels.axis.yLabel && !k.value.useIndividualScale ? (s(), r("text", {
3454
- key: 0,
3455
- ref_key: "yAxisLabel",
3456
- ref: qt,
3457
- "font-size": w.value.yAxis,
3458
- fill: t.value.chart.grid.labels.color,
3459
- transform: `translate(${t.value.chart.grid.labels.axis.fontSize}, ${c.value.top + c.value.height / 2}) rotate(-90)`,
3460
- "text-anchor": "middle",
3461
- style: { transition: "none" }
3462
- }, ne(t.value.chart.grid.labels.axis.yLabel), 9, Vi)) : f("", !0),
3463
- t.value.chart.grid.labels.axis.xLabel ? (s(), r("text", {
3464
- key: 1,
3465
- ref_key: "xAxisLabel",
3466
- ref: Ge,
3467
- "text-anchor": "middle",
3468
- x: ee.value / 2,
3469
- y: ye.value - 3,
3470
- "font-size": w.value.yAxis,
3471
- fill: t.value.chart.grid.labels.color
3472
- }, ne(t.value.chart.grid.labels.axis.xLabel), 9, Ei)) : f("", !0)
3473
- ]),
3474
- t.value.chart.grid.labels.xAxisLabels.show ? (s(), r("g", {
3475
- key: 14,
3476
- ref_key: "timeLabelsEls",
3477
- ref: ht
3478
- }, [
3479
- l.$slots["time-label"] ? (s(!0), r(b, { key: 0 }, C(Jl.value, (e, n) => K(l.$slots, "time-label", Vt({
3480
- key: `time_label_${e.id}`,
3481
- ref_for: !0
3482
- }, {
3483
- x: c.value.left + c.value.width / T.value * n + c.value.width / T.value / 2,
3484
- y: c.value.bottom,
3485
- fontSize: w.value.xAxis,
3486
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3487
- transform: `translate(${c.value.left + c.value.width / T.value * n + c.value.width / T.value / 2}, ${c.value.bottom + w.value.xAxis * 1.3 + t.value.chart.grid.labels.xAxisLabels.yOffset}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3488
- absoluteIndex: e.absoluteIndex,
3489
- content: e.text,
3490
- textAnchor: t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3491
- show: e && e.text
3492
- }), void 0, !0)), 128)) : (s(!0), r(b, { key: 1 }, C(Jl.value, (e, n) => (s(), r("g", {
3493
- key: `time_label_${n}`
3494
- }, [
3495
- e && e.text ? (s(), r(b, { key: 0 }, [
3496
- String(e.text).includes(`
3497
- `) ? (s(), r("text", {
3498
- key: 1,
3499
- class: "vue-data-ui-time-label",
3500
- "text-anchor": t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3501
- "font-size": w.value.xAxis,
3502
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3503
- transform: `translate(${c.value.left + c.value.width / T.value * n + c.value.width / T.value / 2}, ${c.value.bottom + w.value.xAxis * 1.5}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3504
- style: _({
3505
- cursor: ca() ? "pointer" : "default"
3506
- }),
3507
- innerHTML: v(en)({
3508
- content: String(e.text),
3509
- fontSize: w.value.xAxis,
3510
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3511
- x: 0,
3512
- y: 0
3513
- }),
3514
- onClick: () => ma(e, n)
3515
- }, null, 12, Wi)) : (s(), r("text", {
3516
- key: 0,
3517
- class: "vue-data-ui-time-label",
3518
- "text-anchor": t.value.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : t.value.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
3519
- "font-size": w.value.xAxis,
3520
- fill: t.value.chart.grid.labels.xAxisLabels.color,
3521
- transform: `translate(${c.value.left + c.value.width / T.value * n + c.value.width / T.value / 2}, ${c.value.bottom + w.value.xAxis * 1.5}), rotate(${t.value.chart.grid.labels.xAxisLabels.rotation})`,
3522
- style: _({
3523
- cursor: ca() ? "pointer" : "default"
3524
- }),
3525
- onClick: () => ma(e, n)
3526
- }, ne(e.text || ""), 13, Di))
3527
- ], 64)) : f("", !0)
3528
- ]))), 128))
3529
- ], 512)) : f("", !0),
3530
- Ca.value.length && !k.value.isStacked ? (s(), r("g", Xi, [
3531
- (s(!0), r(b, null, C(Ca.value, (e) => (s(), r("g", {
3532
- key: e.uid
3533
- }, [
3534
- e.yTop && e.show && isFinite(e.yTop) ? (s(), r("line", {
3535
- key: 0,
3536
- x1: e.x1,
3537
- y1: e.yTop,
3538
- x2: e.x2,
3539
- y2: e.yTop,
3540
- stroke: e.config.line.stroke,
3541
- "stroke-width": e.config.line.strokeWidth,
3542
- "stroke-dasharray": e.config.line.strokeDasharray,
3543
- "stroke-linecap": "round",
3544
- style: { animation: "none !important" }
3545
- }, null, 8, Yi)) : f("", !0),
3546
- e.yBottom && e.show && isFinite(e.yBottom) ? (s(), r("line", {
3547
- key: 1,
3548
- x1: e.x1,
3549
- y1: e.yBottom,
3550
- x2: e.x2,
3551
- y2: e.yBottom,
3552
- stroke: e.config.line.stroke,
3553
- "stroke-width": e.config.line.strokeWidth,
3554
- "stroke-dasharray": e.config.line.strokeDasharray,
3555
- "stroke-linecap": "round",
3556
- style: { animation: "none !important" }
3557
- }, null, 8, Gi)) : f("", !0),
3558
- e.hasArea && e.show && isFinite(e.yTop) && isFinite(e.yBottom) ? (s(), r("rect", {
3559
- key: 2,
3560
- y: Math.min(e.yTop, e.yBottom),
3561
- x: e.x1,
3562
- width: c.value.width,
3563
- height: v(W)(e.areaHeight, 0),
3564
- fill: v(nt)(e.config.area.fill, e.config.area.opacity),
3565
- style: { animation: "none !important" }
3566
- }, null, 8, Ui)) : f("", !0),
3567
- e.config.label.text && e.show && isFinite(e._box.y) ? (s(), r("rect", Vt({
3568
- key: 3,
3569
- class: "vue-ui-xy-annotation-label-box"
3570
- }, { ref_for: !0 }, e._box, { style: { animation: "none !important", transition: "none !important" } }), null, 16)) : f("", !0),
3571
- e.config.label.text && e.show && isFinite(e._text.y) ? (s(), r("text", {
3572
- key: 4,
3573
- id: e.id,
3574
- class: "vue-ui-xy-annotation-label",
3575
- x: e._text.x,
3576
- y: e._text.y,
3577
- "font-size": e.config.label.fontSize,
3578
- fill: e.config.label.color,
3579
- "text-anchor": e.config.label.textAnchor
3580
- }, ne(e.config.label.text), 9, qi)) : f("", !0)
3581
- ]))), 128))
3582
- ])) : f("", !0),
3583
- t.value.chart.timeTag.show && (![null, void 0].includes(L.value) || ![null, void 0].includes(O.value)) ? (s(), r("g", Zi, [
3584
- (s(), r("foreignObject", {
3585
- x: Io(),
3586
- y: c.value.bottom,
3587
- width: "200",
3588
- height: "40",
3589
- style: { overflow: "visible !important" }
3590
- }, [
3591
- y("div", {
3592
- ref_key: "timeTagEl",
3593
- ref: Ea,
3594
- class: "vue-ui-xy-time-tag",
3595
- style: _(`width: fit-content;margin: 0 auto;text-align:center;padding:3px 12px;background:${t.value.chart.timeTag.backgroundColor};color:${t.value.chart.timeTag.color};font-size:${t.value.chart.timeTag.fontSize}px`),
3596
- innerHTML: No.value
3597
- }, null, 12, Ji)
3598
- ], 8, Ki)),
3599
- y("circle", {
3600
- cx: c.value.left + c.value.width / T.value * ((L.value !== null ? L.value : 0) || (O.value !== null ? O.value : 0)) + c.value.width / T.value / 2,
3601
- cy: c.value.bottom,
3602
- r: t.value.chart.timeTag.circleMarker.radius,
3603
- fill: t.value.chart.timeTag.circleMarker.color
3604
- }, null, 8, Qi)
3605
- ])) : f("", !0)
3606
- ])) : f("", !0),
3607
- kl.value ? (s(), r("rect", Vt({ key: 2 }, tl.value, {
3608
- "data-start": p.value.start,
3609
- "data-end": p.value.end
3610
- }), null, 16, ji)) : f("", !0),
3611
- K(l.$slots, "svg", { svg: Al.value }, void 0, !0)
3612
- ], 512)
3613
- ], 46, Dn)),
3614
- l.$slots.watermark ? (s(), r("div", es, [
3615
- K(l.$slots, "watermark", At(zt({ isPrinting: v(ie) || v(m) })), void 0, !0)
3616
- ])) : f("", !0),
3617
- (s(!0), r(b, null, C(Pe.value, (e, n) => (s(), r(b, {
3618
- key: `tag_line_${e.id}`
3619
- }, [
3620
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3621
- key: `tag_line_${n}_${i}`
3622
- }, [
3623
- [O.value, L.value, ft.value].includes(i) && e.useTag && e.useTag === "end" && t.value.line.tag.followValue ? (s(), r("div", {
3624
- key: 0,
3625
- ref_for: !0,
3626
- ref: (o) => zl(n, i, o, "right", "line"),
3627
- class: "vue-ui-xy-tag",
3628
- "data-tag": "right",
3629
- style: _({
3630
- position: "fixed",
3631
- top: v(Tt)({
3632
- svgElement: Ae.value,
3633
- x: c.value.right + t.value.line.tag.fontSize / 1.5,
3634
- y: a.y,
3635
- element: et.value[`${n}_${i}_right_line`],
3636
- position: "right"
3637
- }).top + "px",
3638
- left: v(Tt)({
3639
- svgElement: Ae.value,
3640
- x: c.value.right + t.value.line.tag.fontSize / 1.5,
3641
- y: a.y,
3642
- element: et.value[`${n}_${i}_right_line`],
3643
- position: "right"
3644
- }).left + "px",
3645
- height: "fit-content",
3646
- width: "fit-content",
3647
- background: e.color,
3648
- color: v(ut)(e.color),
3649
- padding: "0 6px",
3650
- fontSize: t.value.line.tag.fontSize + "px",
3651
- opacity: 1
3652
- })
3653
- }, [
3654
- (s(), r("svg", ts, [
3655
- y("path", {
3656
- d: "M 0,10 10,0 10,20 Z",
3657
- fill: e.color,
3658
- stroke: "none"
3659
- }, null, 8, ls)
3660
- ])),
3661
- y("div", {
3662
- class: "vue-ui-xy-tag-content",
3663
- innerHTML: v(Le)(
3664
- t.value.line.tag.formatter,
3665
- a.value,
3666
- e.name,
3667
- {
3668
- datapoint: a,
3669
- seriesIndex: i,
3670
- serieName: e.name
3671
- }
3672
- )
3673
- }, null, 8, as)
3674
- ], 4)) : f("", !0),
3675
- [O.value, L.value, ft.value].includes(i) && e.useTag && e.useTag === "start" && t.value.line.tag.followValue ? (s(), r("div", {
3676
- key: 1,
3677
- ref_for: !0,
3678
- ref: (o) => zl(n, i, o, "left", "line"),
3679
- class: "vue-ui-xy-tag",
3680
- "data-tag": "left",
3681
- style: _({
3682
- position: "fixed",
3683
- top: v(Tt)({
3684
- svgElement: Ae.value,
3685
- x: c.value.left - t.value.line.tag.fontSize / 1.5,
3686
- y: a.y,
3687
- element: et.value[`${n}_${i}_left_line`],
3688
- position: "left"
3689
- }).top + "px",
3690
- left: v(Tt)({
3691
- svgElement: Ae.value,
3692
- x: c.value.left - t.value.line.tag.fontSize / 1.5,
3693
- y: a.y,
3694
- element: et.value[`${n}_${i}_left_line`],
3695
- position: "left"
3696
- }).left + "px",
3697
- height: "fit-content",
3698
- width: "fit-content",
3699
- background: e.color,
3700
- color: v(ut)(e.color),
3701
- padding: "0 6px",
3702
- fontSize: t.value.line.tag.fontSize + "px",
3703
- opacity: 1
3704
- })
3705
- }, [
3706
- (s(), r("svg", os, [
3707
- y("path", {
3708
- d: "M 0,0 10,10 0,20 Z",
3709
- fill: e.color,
3710
- stroke: "none"
3711
- }, null, 8, ns)
3712
- ])),
3713
- y("div", {
3714
- class: "vue-ui-xy-tag-content",
3715
- innerHTML: v(Le)(
3716
- t.value.line.tag.formatter,
3717
- a.value,
3718
- e.name,
3719
- {
3720
- datapoint: a,
3721
- seriesIndex: i,
3722
- serieName: e.name
3723
- }
3724
- )
3725
- }, null, 8, us)
3726
- ], 4)) : f("", !0)
3727
- ], 64))), 128))
3728
- ], 64))), 128)),
3729
- (s(!0), r(b, null, C(ot.value, (e, n) => (s(), r(b, {
3730
- key: `tag_plot_${e.id}`
3731
- }, [
3732
- (s(!0), r(b, null, C(e.plots, (a, i) => (s(), r(b, {
3733
- key: `tag_plot_${n}_${i}`
3734
- }, [
3735
- [O.value, L.value, ft.value].includes(i) && e.useTag && e.useTag === "end" && t.value.plot.tag.followValue ? (s(), r("div", {
3736
- key: 0,
3737
- ref_for: !0,
3738
- ref: (o) => zl(n, i, o, "right", "plot"),
3739
- class: "vue-ui-xy-tag",
3740
- "data-tag": "right",
3741
- style: _({
3742
- position: "fixed",
3743
- top: v(Tt)({
3744
- svgElement: Ae.value,
3745
- x: c.value.right + t.value.plot.tag.fontSize / 1.5,
3746
- y: a.y,
3747
- element: et.value[`${n}_${i}_right_plot`],
3748
- position: "right"
3749
- }).top + "px",
3750
- left: v(Tt)({
3751
- svgElement: Ae.value,
3752
- x: c.value.right + t.value.plot.tag.fontSize / 1.5,
3753
- y: a.y,
3754
- element: et.value[`${n}_${i}_right_plot`],
3755
- position: "right"
3756
- }).left + "px",
3757
- height: "fit-content",
3758
- width: "fit-content",
3759
- background: e.color,
3760
- color: v(ut)(e.color),
3761
- padding: "0 6px",
3762
- fontSize: t.value.plot.tag.fontSize + "px",
3763
- opacity: 1
3764
- })
3765
- }, [
3766
- (s(), r("svg", is, [
3767
- y("path", {
3768
- d: "M 0,10 10,0 10,20 Z",
3769
- fill: e.color,
3770
- stroke: "none"
3771
- }, null, 8, ss)
3772
- ])),
3773
- y("div", {
3774
- class: "vue-ui-xy-tag-content",
3775
- innerHTML: v(Le)(
3776
- t.value.plot.tag.formatter,
3777
- a.value,
3778
- e.name,
3779
- {
3780
- datapoint: a,
3781
- seriesIndex: i,
3782
- serieName: e.name
3783
- }
3784
- )
3785
- }, null, 8, rs)
3786
- ], 4)) : f("", !0),
3787
- [O.value, L.value, ft.value].includes(i) && e.useTag && e.useTag === "start" && t.value.plot.tag.followValue ? (s(), r("div", {
3788
- key: 1,
3789
- ref_for: !0,
3790
- ref: (o) => zl(n, i, o, "left", "plot"),
3791
- class: "vue-ui-xy-tag",
3792
- "data-tag": "left",
3793
- style: _({
3794
- position: "fixed",
3795
- top: v(Tt)({
3796
- svgElement: Ae.value,
3797
- x: c.value.left - t.value.plot.tag.fontSize / 1.5,
3798
- y: a.y,
3799
- element: et.value[`${n}_${i}_left_plot`],
3800
- position: "left"
3801
- }).top + "px",
3802
- left: v(Tt)({
3803
- svgElement: Ae.value,
3804
- x: c.value.left - t.value.plot.tag.fontSize / 1.5,
3805
- y: a.y,
3806
- element: et.value[`${n}_${i}_left_plot`],
3807
- position: "left"
3808
- }).left + "px",
3809
- height: "fit-content",
3810
- width: "fit-content",
3811
- background: e.color,
3812
- color: v(ut)(e.color),
3813
- padding: "0 6px",
3814
- fontSize: t.value.plot.tag.fontSize + "px",
3815
- opacity: 1
3816
- })
3817
- }, [
3818
- (s(), r("svg", cs, [
3819
- y("path", {
3820
- d: "M 0,0 10,10 0,20 Z",
3821
- fill: e.color,
3822
- stroke: "none"
3823
- }, null, 8, vs)
3824
- ])),
3825
- y("div", {
3826
- class: "vue-ui-xy-tag-content",
3827
- innerHTML: v(Le)(
3828
- t.value.plot.tag.formatter,
3829
- a.value,
3830
- e.name,
3831
- {
3832
- datapoint: a,
3833
- seriesIndex: i,
3834
- serieName: e.name
3835
- }
3836
- )
3837
- }, null, 8, ds)
3838
- ], 4)) : f("", !0)
3839
- ], 64))), 128))
3840
- ], 64))), 128)),
3841
- t.value.chart.zoom.preview.enable ? (s(), r(b, { key: 5 }, [
3842
- t.value.chart.zoom.show && ze.value > 6 && jt.value ? (s(), Je(Hn, {
3843
- ref_key: "chartSlicer",
3844
- ref: He,
3845
- key: `slicer_${St.value}`,
3846
- max: ze.value,
3847
- min: 0,
3848
- valueStart: p.value.start,
3849
- valueEnd: p.value.end,
3850
- start: p.value.start,
3851
- "onUpdate:start": u[1] || (u[1] = (e) => p.value.start = e),
3852
- end: p.value.end,
3853
- "onUpdate:end": u[2] || (u[2] = (e) => p.value.end = e),
3854
- selectedSeries: pt.value,
3855
- customFormat: t.value.chart.zoom.customFormat,
3856
- background: t.value.chart.zoom.color,
3857
- fontSize: t.value.chart.zoom.fontSize,
3858
- useResetSlot: t.value.chart.zoom.useResetSlot,
3859
- labelLeft: _e.value[0] ? _e.value[0].text : "",
3860
- labelRight: _e.value.at(-1) ? _e.value.at(-1).text : "",
3861
- textColor: t.value.chart.color,
3862
- usePreciseLabels: t.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !t.value.chart.zoom.useDefaultFormat,
3863
- preciseLabels: ea.value,
3864
- inputColor: t.value.chart.zoom.color,
3865
- selectColor: t.value.chart.zoom.highlightColor,
3866
- borderColor: t.value.chart.backgroundColor,
3867
- minimap: La.value,
3868
- smoothMinimap: t.value.chart.zoom.minimap.smooth,
3869
- minimapSelectedColor: t.value.chart.zoom.minimap.selectedColor,
3870
- minimapSelectionRadius: t.value.chart.zoom.minimap.selectionRadius,
3871
- minimapLineColor: t.value.chart.zoom.minimap.lineColor,
3872
- minimapSelectedColorOpacity: t.value.chart.zoom.minimap.selectedColorOpacity,
3873
- minimapSelectedIndex: L.value,
3874
- minimapIndicatorColor: t.value.chart.zoom.minimap.indicatorColor,
3875
- verticalHandles: t.value.chart.zoom.minimap.verticalHandles,
3876
- refreshStartPoint: t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex : 0,
3877
- refreshEndPoint: t.value.chart.zoom.endIndex !== null ? t.value.chart.zoom.endIndex + 1 : Math.max(...N.dataset.map((e) => Se(e.series).length)),
3878
- enableRangeHandles: t.value.chart.zoom.enableRangeHandles,
3879
- enableSelectionDrag: t.value.chart.zoom.enableSelectionDrag,
3880
- onReset: xa,
3881
- onTrapMouse: ga,
3882
- onFutureStart: u[3] || (u[3] = (e) => $t("start", e)),
3883
- onFutureEnd: u[4] || (u[4] = (e) => $t("end", e)),
3884
- timeLabels: fa.value,
3885
- isPreview: kl.value
3886
- }, {
3887
- "reset-action": be(({ reset: e }) => [
3888
- K(l.$slots, "reset-action", At(zt({ reset: e })), void 0, !0)
3889
- ]),
3890
- _: 3
3891
- }, 8, ["max", "valueStart", "valueEnd", "start", "end", "selectedSeries", "customFormat", "background", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "usePreciseLabels", "preciseLabels", "inputColor", "selectColor", "borderColor", "minimap", "smoothMinimap", "minimapSelectedColor", "minimapSelectionRadius", "minimapLineColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapIndicatorColor", "verticalHandles", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag", "timeLabels", "isPreview"])) : f("", !0)
3892
- ], 64)) : (s(), r(b, { key: 6 }, [
3893
- t.value.chart.zoom.show && ze.value > 6 && jt.value ? (s(), Je(mn, {
3894
- ref_key: "chartSlicer",
3895
- ref: He,
3896
- key: `slicer_${St.value}`,
3897
- max: ze.value,
3898
- min: 0,
3899
- valueStart: p.value.start,
3900
- valueEnd: p.value.end,
3901
- start: p.value.start,
3902
- "onUpdate:start": u[5] || (u[5] = (e) => p.value.start = e),
3903
- end: p.value.end,
3904
- "onUpdate:end": u[6] || (u[6] = (e) => p.value.end = e),
3905
- background: t.value.chart.zoom.color,
3906
- fontSize: t.value.chart.zoom.fontSize,
3907
- useResetSlot: t.value.chart.zoom.useResetSlot,
3908
- labelLeft: Ia.value.left,
3909
- labelRight: Ia.value.right,
3910
- textColor: t.value.chart.color,
3911
- inputColor: t.value.chart.zoom.color,
3912
- selectColor: t.value.chart.zoom.highlightColor,
3913
- borderColor: t.value.chart.backgroundColor,
3914
- minimap: La.value,
3915
- smoothMinimap: t.value.chart.zoom.minimap.smooth,
3916
- minimapSelectedColor: t.value.chart.zoom.minimap.selectedColor,
3917
- minimapSelectionRadius: t.value.chart.zoom.minimap.selectionRadius,
3918
- minimapLineColor: t.value.chart.zoom.minimap.lineColor,
3919
- minimapSelectedColorOpacity: t.value.chart.zoom.minimap.selectedColorOpacity,
3920
- minimapSelectedIndex: L.value,
3921
- minimapIndicatorColor: t.value.chart.zoom.minimap.indicatorColor,
3922
- verticalHandles: t.value.chart.zoom.minimap.verticalHandles,
3923
- refreshStartPoint: t.value.chart.zoom.startIndex !== null ? t.value.chart.zoom.startIndex : 0,
3924
- refreshEndPoint: t.value.chart.zoom.endIndex !== null ? t.value.chart.zoom.endIndex + 1 : Math.max(...N.dataset.map((e) => Se(e.series).length)),
3925
- enableRangeHandles: t.value.chart.zoom.enableRangeHandles,
3926
- enableSelectionDrag: t.value.chart.zoom.enableSelectionDrag,
3927
- onReset: xa,
3928
- onTrapMouse: ga
3929
- }, {
3930
- "reset-action": be(({ reset: e }) => [
3931
- K(l.$slots, "reset-action", At(zt({ reset: e })), void 0, !0)
3932
- ]),
3933
- _: 3
3934
- }, 8, ["max", "valueStart", "valueEnd", "start", "end", "background", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "borderColor", "minimap", "smoothMinimap", "minimapSelectedColor", "minimapSelectionRadius", "minimapLineColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapIndicatorColor", "verticalHandles", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag"])) : f("", !0)
3935
- ], 64)),
3936
- y("div", {
3937
- id: `legend-bottom-${Y.value}`
3938
- }, null, 8, hs),
3939
- bl.value ? (s(), Je(Vo, {
3940
- key: 7,
3941
- to: t.value.chart.legend.position === "top" ? `#legend-top-${Y.value}` : `#legend-bottom-${Y.value}`
3942
- }, [
3943
- t.value.chart.legend.show ? (s(), r("div", {
3944
- key: 0,
3945
- ref_key: "chartLegend",
3946
- ref: st,
3947
- class: "vue-ui-xy-legend",
3948
- style: _({
3949
- fontSize: `var(--legend-font-size, ${t.value.chart.legend.fontSize ?? 14}px)`
3950
- })
3951
- }, [
3952
- (s(!0), r(b, null, C(Ze.value, (e, n) => (s(), r("div", {
3953
- key: `div_legend_item_${n}`,
3954
- onClick: (a) => _a(e),
3955
- class: Xe({ "vue-ui-xy-legend-item-alone": Ze.value.length === 1, "vue-ui-xy-legend-item": !0, "vue-ui-xy-legend-item-segregated": ue.value.includes(e.id) })
3956
- }, [
3957
- we.value[e.type] === "line" ? (s(), r("svg", ms, [
3958
- y("rect", {
3959
- x: "0",
3960
- y: "7.5",
3961
- rx: "1.5",
3962
- stroke: t.value.chart.backgroundColor,
3963
- "stroke-width": 0.5,
3964
- height: "3",
3965
- width: "20",
3966
- fill: e.color
3967
- }, null, 8, gs),
3968
- Wt(El, {
3969
- plot: { x: 10, y: 9 },
3970
- radius: 4,
3971
- color: e.color,
3972
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle",
3973
- stroke: t.value.chart.backgroundColor,
3974
- strokeWidth: 0.5
3975
- }, null, 8, ["color", "shape", "stroke"])
3976
- ])) : we.value[e.type] === "bar" ? (s(), r("svg", bs, [
3977
- we.value[e.type] === "bar" && l.$slots.pattern ? (s(), r("rect", {
3978
- key: 0,
3979
- x: "4",
3980
- y: "4",
3981
- rx: "1",
3982
- height: "32",
3983
- width: "32",
3984
- stroke: "none",
3985
- fill: e.color
3986
- }, null, 8, xs)) : f("", !0),
3987
- we.value[e.type] === "bar" ? (s(), r("rect", {
3988
- key: 1,
3989
- x: "4",
3990
- y: "4",
3991
- rx: "1",
3992
- height: "32",
3993
- width: "32",
3994
- stroke: "none",
3995
- fill: l.$slots.pattern ? `url(#pattern_${Y.value}_${e.slotAbsoluteIndex})` : e.color
3996
- }, null, 8, ps)) : f("", !0)
3997
- ])) : (s(), r("svg", ys, [
3998
- Wt(El, {
3999
- plot: { x: 6, y: 6 },
4000
- radius: 5,
4001
- color: e.color,
4002
- shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(e.shape) ? e.shape : "circle"
4003
- }, null, 8, ["color", "shape"])
4004
- ])),
4005
- y("span", {
4006
- style: _(`color:${t.value.chart.legend.color}`)
4007
- }, ne(e.name), 5)
4008
- ], 10, fs))), 128))
4009
- ], 4)) : (s(), r("div", {
4010
- key: 1,
4011
- ref_key: "chartLegend",
4012
- ref: st
4013
- }, [
4014
- K(l.$slots, "legend", { legend: Ze.value }, void 0, !0)
4015
- ], 512))
4016
- ], 8, ["to"])) : f("", !0),
4017
- l.$slots.source ? (s(), r("div", {
4018
- key: 8,
4019
- ref_key: "source",
4020
- ref: It,
4021
- dir: "auto"
4022
- }, [
4023
- K(l.$slots, "source", {}, void 0, !0)
4024
- ], 512)) : f("", !0),
4025
- Wt(v(ve), {
4026
- show: k.value.showTooltip && Cl.value,
4027
- backgroundColor: t.value.chart.tooltip.backgroundColor,
4028
- color: t.value.chart.tooltip.color,
4029
- fontSize: t.value.chart.tooltip.fontSize,
4030
- borderRadius: t.value.chart.tooltip.borderRadius,
4031
- borderColor: t.value.chart.tooltip.borderColor,
4032
- borderWidth: t.value.chart.tooltip.borderWidth,
4033
- backgroundOpacity: t.value.chart.tooltip.backgroundOpacity,
4034
- position: t.value.chart.tooltip.position,
4035
- offsetY: t.value.chart.tooltip.offsetY,
4036
- parent: l.$refs.chart,
4037
- content: Ao.value,
4038
- isFullscreen: Re.value,
4039
- isCustom: t.value.chart.tooltip.customFormat && typeof t.value.chart.tooltip.customFormat == "function",
4040
- smooth: t.value.chart.tooltip.smooth,
4041
- backdropFilter: t.value.chart.tooltip.backdropFilter,
4042
- smoothForce: t.value.chart.tooltip.smoothForce,
4043
- smoothSnapThreshold: t.value.chart.tooltip.smoothSnapThreshold
4044
- }, {
4045
- "tooltip-before": be(() => [
4046
- K(l.$slots, "tooltip-before", At(zt({ ...Ta.value })), void 0, !0)
4047
- ]),
4048
- "tooltip-after": be(() => [
4049
- K(l.$slots, "tooltip-after", At(zt({ ...Ta.value })), void 0, !0)
4050
- ]),
4051
- _: 3
4052
- }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom", "smooth", "backdropFilter", "smoothForce", "smoothSnapThreshold"]),
4053
- jt.value && t.value.chart.userOptions.buttons.table ? (s(), Je(Eo(_l.value.component), Vt({ key: 9 }, _l.value.props, {
4054
- ref_key: "tableUnit",
4055
- ref: bt,
4056
- onClose: Xa
4057
- }), qa({
4058
- content: be(() => [
4059
- y("div", {
4060
- style: _(`${v(ie) || t.value.table.useDialog ? "" : "max-height:400px"};${t.value.table.useDialog ? "height: fit-content; " : ""};overflow:auto;width:100%;${t.value.table.useDialog ? "" : "margin-top:48px"}`)
4061
- }, [
4062
- y("div", ks, [
4063
- ia(y("input", {
4064
- type: "checkbox",
4065
- "onUpdate:modelValue": u[8] || (u[8] = (e) => mt.value = e)
4066
- }, null, 512), [
4067
- [Do, mt.value]
4068
- ]),
4069
- y("div", {
4070
- onClick: u[9] || (u[9] = (e) => mt.value = !mt.value),
4071
- style: { cursor: "pointer" }
4072
- }, [
4073
- Wt(v(kt), {
4074
- name: "chartLine",
4075
- size: 20,
4076
- stroke: t.value.chart.color
4077
- }, null, 8, ["stroke"])
4078
- ])
4079
- ]),
4080
- mt.value ? (s(), Je(v(sl), {
4081
- key: `sparkline_${Kt.value}`,
4082
- dataset: Lo.value,
4083
- config: Mo.value
4084
- }, null, 8, ["dataset", "config"])) : (s(), Je(v(Ye), {
4085
- key: `table_${Zt.value}`,
4086
- colNames: Ol.value.colNames,
4087
- head: Ol.value.head,
4088
- body: Ol.value.body,
4089
- config: Ol.value.config,
4090
- title: t.value.table.useDialog ? "" : _l.value.title,
4091
- withCloseButton: !t.value.table.useDialog,
4092
- onClose: Xa
4093
- }, {
4094
- th: be(({ th: e }) => [
4095
- y("div", { innerHTML: e }, null, 8, ws)
4096
- ]),
4097
- td: be(({ td: e }) => [
4098
- Za(ne(isNaN(Number(e)) ? e : v(Qe)({
4099
- p: t.value.chart.labels.prefix,
4100
- v: e,
4101
- s: t.value.chart.labels.suffix,
4102
- r: t.value.table.rounding
4103
- })), 1)
4104
- ]),
4105
- _: 1
4106
- }, 8, ["colNames", "head", "body", "config", "title", "withCloseButton"]))
4107
- ], 4)
4108
- ]),
4109
- _: 2
4110
- }, [
4111
- t.value.table.useDialog ? {
4112
- name: "title",
4113
- fn: be(() => [
4114
- Za(ne(_l.value.title), 1)
4115
- ]),
4116
- key: "0"
4117
- } : void 0,
4118
- t.value.table.useDialog ? {
4119
- name: "actions",
4120
- fn: be(() => [
4121
- y("button", {
4122
- tabindex: "0",
4123
- class: "vue-ui-user-options-button",
4124
- onClick: u[7] || (u[7] = (e) => ta(t.value.chart.userOptions.callbacks.csv))
4125
- }, [
4126
- Wt(v(kt), {
4127
- name: "excel",
4128
- stroke: _l.value.props.color
4129
- }, null, 8, ["stroke"])
4130
- ])
4131
- ]),
4132
- key: "1"
4133
- } : void 0
4134
- ]), 1040)) : f("", !0),
4135
- v(oe) ? (s(), Je(rn, { key: 10 })) : f("", !0)
4136
- ], 46, Vn));
4137
- }
4138
- }, Hs = /* @__PURE__ */ ao(Ss, [["__scopeId", "data-v-76dcbded"]]);
4139
- export {
4140
- Hs as default
4141
- };