vue-data-ui 3.16.4 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -46
- package/dist/{PackageVersion-1BHnPIBZ.js → PackageVersion-B3kmPxTR.js} +1 -1
- package/dist/{Slicer-DUycDH_N.js → Slicer-CIHwwuNR.js} +107 -110
- package/dist/SlicerPreview-BIvxyb5W.js +1484 -0
- package/dist/{Tooltip-Bf-kM3_A.js → Tooltip-C8KGyqQk.js} +19 -17
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +1 -1
- package/dist/{useConfig-CpJA0VZa.js → useConfig-ChRble71.js} +1 -0
- package/dist/{useObjectBindings-DToqZaRC.js → useObjectBindings-BVFCsss5.js} +1 -1
- package/dist/utils.js +1 -1
- package/dist/{vue-data-ui-D28lrXzG.js → vue-data-ui-BX3I-ZQt.js} +67 -67
- package/dist/vue-data-ui.js +68 -68
- package/dist/{vue-ui-3d-bar-BOrQb1Zm.js → vue-ui-3d-bar-DsSxN6Xl.js} +2 -2
- package/dist/{vue-ui-accordion-BF4v32wv.js → vue-ui-accordion-CnDW2UQL.js} +1 -1
- package/dist/{vue-ui-age-pyramid-txthNdz1.js → vue-ui-age-pyramid-DgAJXx1F.js} +112 -109
- package/dist/{vue-ui-annotator-U961V1Kc.js → vue-ui-annotator-BA4hRkfX.js} +2 -2
- package/dist/{vue-ui-bullet-BboXC-yM.js → vue-ui-bullet-BCuT1zVr.js} +2 -2
- package/dist/{vue-ui-bump-oRhoxgeR.js → vue-ui-bump-BTnwgB5Q.js} +2 -2
- package/dist/{vue-ui-candlestick-RAgVO1Hl.js → vue-ui-candlestick-BMvM7WIc.js} +148 -145
- package/dist/{vue-ui-carousel-table-BFqP05En.js → vue-ui-carousel-table-DCtWIG49.js} +2 -2
- package/dist/{vue-ui-chestnut-ComiA10N.js → vue-ui-chestnut-DJ0R3Aqx.js} +2 -2
- package/dist/{vue-ui-chord-D9dLOTr5.js → vue-ui-chord-BbWToSBq.js} +2 -2
- package/dist/{vue-ui-circle-pack-pqOFrf-X.js → vue-ui-circle-pack-CwuEfQPE.js} +117 -114
- package/dist/{vue-ui-cursor-BmAytuMu.js → vue-ui-cursor-C4MnK_CE.js} +2 -2
- package/dist/{vue-ui-dag-CuJNCfFw.js → vue-ui-dag-HKbeFOit.js} +2 -2
- package/dist/{vue-ui-dashboard-DDuu-xwh.js → vue-ui-dashboard-DTYz-idn.js} +65 -65
- package/dist/{vue-ui-digits-DYKnwhao.js → vue-ui-digits-CrFH4BlD.js} +2 -2
- package/dist/{vue-ui-donut-CbD2wI-a.js → vue-ui-donut-B1C7vzFY.js} +100 -97
- package/dist/{vue-ui-donut-evolution-BdA0k4Eg.js → vue-ui-donut-evolution-BUIQwZ-c.js} +3 -3
- package/dist/{vue-ui-dumbbell-CPbXszE_.js → vue-ui-dumbbell-Bq-X5L24.js} +2 -2
- package/dist/{vue-ui-flow-RyxU8f22.js → vue-ui-flow-DUn9hp_J.js} +141 -138
- package/dist/{vue-ui-funnel-Cda_iN_h.js → vue-ui-funnel-CNF2ULOQ.js} +2 -2
- package/dist/{vue-ui-galaxy-BNUPKqkV.js → vue-ui-galaxy-BzlU9OSU.js} +75 -72
- package/dist/{vue-ui-gauge-CihaQBsc.js → vue-ui-gauge-aF_V6ynK.js} +2 -2
- package/dist/{vue-ui-geo-Da95dDom.js → vue-ui-geo-xaZvHjAP.js} +116 -113
- package/dist/{vue-ui-gizmo-DzHN0cW5.js → vue-ui-gizmo-BGvS_AHj.js} +2 -2
- package/dist/{vue-ui-heatmap-DqQiO1Oz.js → vue-ui-heatmap-B_BmpyVy.js} +191 -188
- package/dist/{vue-ui-history-plot-DqeaH_61.js → vue-ui-history-plot-DsoLp3aL.js} +124 -121
- package/dist/{vue-ui-horizontal-bar-CX6TPm9_.js → vue-ui-horizontal-bar-JVjE88ZW.js} +218 -215
- package/dist/{vue-ui-kpi-OxZqguE4.js → vue-ui-kpi-B-v1zpd4.js} +2 -2
- package/dist/{vue-ui-mini-loader-DSQ9kcmW.js → vue-ui-mini-loader-CPfZsqWP.js} +1 -1
- package/dist/{vue-ui-molecule-CTm126iW.js → vue-ui-molecule-Di9_wsME.js} +61 -58
- package/dist/{vue-ui-mood-radar-C0E6bq6E.js → vue-ui-mood-radar-CetQpdnu.js} +2 -2
- package/dist/{vue-ui-nested-donuts-Bh0ZICKK.js → vue-ui-nested-donuts-Y-UMjjYV.js} +131 -128
- package/dist/{vue-ui-onion-QsjwjlCa.js → vue-ui-onion-MM3QZLzF.js} +142 -139
- package/dist/{vue-ui-parallel-coordinate-plot-wJcWVLAC.js → vue-ui-parallel-coordinate-plot-CcHmB0MQ.js} +91 -88
- package/dist/{vue-ui-quadrant-lJ7T6q87.js → vue-ui-quadrant-CQIMUggy.js} +58 -55
- package/dist/{vue-ui-quick-chart-CEMQYbSC.js → vue-ui-quick-chart-lwGufdDj.js} +235 -232
- package/dist/{vue-ui-radar-d7b-Y40r.js → vue-ui-radar-CS74L65M.js} +117 -114
- package/dist/{vue-ui-rating-hudM2QS0.js → vue-ui-rating-DiLLVHq3.js} +1 -1
- package/dist/{vue-ui-relation-circle-_PoDqM8x.js → vue-ui-relation-circle-D3dO8RTC.js} +2 -2
- package/dist/{vue-ui-ridgeline-BU_EA8-u.js → vue-ui-ridgeline-Dpvq9yp2.js} +2 -2
- package/dist/{vue-ui-rings-BQKtt-FQ.js → vue-ui-rings-D-45pPpZ.js} +122 -119
- package/dist/{vue-ui-scatter-Bh95G7ZD.js → vue-ui-scatter-BzCjfGB9.js} +121 -118
- package/dist/{vue-ui-skeleton-BIw-u4zp.js → vue-ui-skeleton-Dai-bZZw.js} +2 -2
- package/dist/{vue-ui-smiley-CQ_rGHFe.js → vue-ui-smiley-BioqmYwT.js} +1 -1
- package/dist/{vue-ui-spark-trend-D4QxExdm.js → vue-ui-spark-trend-DiC9V0VU.js} +2 -2
- package/dist/{vue-ui-sparkbar-BmiEOs4E.js → vue-ui-sparkbar-D6EsbW6u.js} +2 -2
- package/dist/{vue-ui-sparkgauge-hwEkTICS.js → vue-ui-sparkgauge-BHDXZgJH.js} +2 -2
- package/dist/{vue-ui-sparkhistogram-DEkO_5i3.js → vue-ui-sparkhistogram-DzuOjuNH.js} +2 -2
- package/dist/{vue-ui-sparkline-DFnG0CrA.js → vue-ui-sparkline-B-zOqzrC.js} +288 -276
- package/dist/{vue-ui-sparkstackbar-CQqUPbkU.js → vue-ui-sparkstackbar-bqKzIKSg.js} +147 -144
- package/dist/{vue-ui-stackbar-BcP_TA9R.js → vue-ui-stackbar-DPfxqQUG.js} +435 -424
- package/dist/{vue-ui-stackline-Bnuj-z-G.js → vue-ui-stackline-Ctqe1OuF.js} +627 -609
- package/dist/{vue-ui-strip-plot-B-tszwir.js → vue-ui-strip-plot-Dg2URhvc.js} +72 -69
- package/dist/{vue-ui-table-heatmap-DU7w6PrX.js → vue-ui-table-heatmap-Da6sqBlI.js} +1 -1
- package/dist/{vue-ui-table-sparkline-DHjZyVAg.js → vue-ui-table-sparkline-Bkv6Qz6V.js} +2 -2
- package/dist/{vue-ui-table-BVQyX-Yx.js → vue-ui-table-xrD-xqis.js} +3 -3
- package/dist/{vue-ui-thermometer-ZED83TXZ.js → vue-ui-thermometer-D7VVeA2i.js} +2 -2
- package/dist/{vue-ui-timer-Xg7H9EaE.js → vue-ui-timer-D7XYgZfb.js} +2 -2
- package/dist/{vue-ui-tiremarks-BDoU-BcX.js → vue-ui-tiremarks-i6e8GTI9.js} +2 -2
- package/dist/{vue-ui-treemap-BcS1k9hJ.js → vue-ui-treemap-D8Mbfeuc.js} +220 -217
- package/dist/{vue-ui-waffle-CSvzbC5u.js → vue-ui-waffle-7rVD530d.js} +123 -120
- package/dist/{vue-ui-wheel-BrLKEar8.js → vue-ui-wheel-HQNWtsvJ.js} +2 -2
- package/dist/{vue-ui-word-cloud-D05ZR0u7.js → vue-ui-word-cloud-DFAEbzUa.js} +159 -156
- package/dist/{vue-ui-world-CtPJIK5c.js → vue-ui-world-YvmrdfIm.js} +86 -83
- package/dist/vue-ui-xy-canvas-CEaAQ_tr.js +1819 -0
- package/dist/{vue-ui-xy-5mNo0EDu.js → vue-ui-xy-n4juEarQ.js} +402 -398
- package/package.json +1 -1
- package/dist/SlicerPreview-DTjwV0iY.js +0 -1372
- package/dist/vue-ui-xy-canvas-CaoWw3AU.js +0 -1810
|
@@ -0,0 +1,1819 @@
|
|
|
1
|
+
import { defineAsyncComponent as ze, ref as c, computed as g, useSlots as vl, onMounted as Ja, toRefs as cl, watch as E, nextTick as Te, onBeforeUnmount as sa, watchEffect as ua, shallowRef as na, openBlock as I, createElementBlock as $e, normalizeClass as dl, normalizeStyle as ve, createElementVNode as H, toDisplayString as Ae, createBlock as q, createCommentVNode as W, unref as z, createSlots as Qa, withCtx as b, renderSlot as C, normalizeProps as j, guardReactiveProps as G, createVNode as et, Teleport as hl, resolveDynamicComponent as fl, mergeProps as ml, createTextVNode as at } from "vue";
|
|
2
|
+
import { j as yl, t as tt, m as gl, p as se, $ as pl, n as bl, D as ra, k as ce, l as de, s as lt, H as xl, a8 as Ll, J as Cl, o as kl, q as wl, T as ia, u as Ie, x as Sl, a0 as zl, a1 as Tl, U as ot } from "./lib-DBptbyyI.js";
|
|
3
|
+
import { c as $l, a as va, d as Al, t as Il, u as Ml, l as T, r as Ve, b as Q, p as st } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as Fl, a as ut, b as Pl } from "./useTimeLabels-C-A2uZKi.js";
|
|
5
|
+
import { u as Rl } from "./useConfig-ChRble71.js";
|
|
6
|
+
import { u as Dl, B as Ol } from "./BaseScanner-BhhkKVoj.js";
|
|
7
|
+
import { u as El } from "./usePrinter-CEpYU3r5.js";
|
|
8
|
+
import { u as Ue } from "./useNestedProp-Bf5XFbs8.js";
|
|
9
|
+
import { u as Nl } from "./useThemeCheck-D1ZYXUwG.js";
|
|
10
|
+
import { u as Bl } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
|
+
import { u as Hl } from "./useChartAccessibility-9icAAmYg.js";
|
|
12
|
+
import Wl from "./img-LXxMLmCg.js";
|
|
13
|
+
import Xl from "./vue_ui_xy_canvas-6BBDSowT.js";
|
|
14
|
+
import _l from "./Legend-CS7Xo5LK.js";
|
|
15
|
+
import Vl from "./Title-BeMKE1cj.js";
|
|
16
|
+
import Ul from "./BaseIcon-Cb3zzG6s.js";
|
|
17
|
+
import Yl from "./vue-ui-accordion-CnDW2UQL.js";
|
|
18
|
+
import { S as ql } from "./SlicerPreview-BIvxyb5W.js";
|
|
19
|
+
import { B as jl } from "./BaseLegendToggle-BQVIawmA.js";
|
|
20
|
+
import { _ as Gl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
21
|
+
const Zl = ["id"], Kl = ["id"], Jl = {
|
|
22
|
+
class: "sr-only",
|
|
23
|
+
"aria-live": "polite",
|
|
24
|
+
"aria-atomic": "true"
|
|
25
|
+
}, Ql = ["id"], eo = ["aria-label", "aria-describedby"], ao = {
|
|
26
|
+
key: 0,
|
|
27
|
+
style: { position: "absolute", top: "100%", left: "0", width: "100%" },
|
|
28
|
+
"data-dom-to-png-ignore": "",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}, to = ["id"], lo = ["onClick"], oo = {
|
|
31
|
+
key: 4,
|
|
32
|
+
class: "vue-data-ui-watermark"
|
|
33
|
+
}, so = ["innerHTML"], uo = {
|
|
34
|
+
__name: "vue-ui-xy-canvas",
|
|
35
|
+
props: {
|
|
36
|
+
dataset: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default() {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
config: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default() {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
selectedXIndex: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: void 0
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
emits: ["selectLegend", "selectX", "copyAlt"],
|
|
54
|
+
setup(ca, { expose: nt, emit: rt }) {
|
|
55
|
+
const it = ze(() => import("./Tooltip-C8KGyqQk.js")), vt = ze(() => import("./DataTable-DT2kIdQ6.js")), ct = ze(() => import("./UserOptions-rW2fRf3V.js")), dt = ze(() => import("./NonSvgPenAndPaper-VyJFyJ6X.js")), ht = ze(() => import("./BaseDraggableDialog-CIb-iD9g.js")), { vue_ui_xy_canvas: ft } = Rl(), { isThemeValid: mt, warnInvalidTheme: yt } = Nl(), D = ca, Z = c(yl()), K = c(null), ue = c(null), v = c(null), y = c(1), ee = c(1), he = c(!1), h = c(null), fe = c(""), Me = c(null), p = c([]), ne = c(1), N = c(!0), X = c(!0), Fe = c(null), da = c(0), me = c(!1), ha = c(null), fa = c(null), ae = c(null), ma = c(null), Ye = c(0), qe = c(0), je = c(0), _ = c(null), ya = c(!1), ye = c(null), Ge = c(null), ge = c(!1), ga = c(!1), Pe = c(!1), $ = c(null), Ze = c(!1), Re = c(!1), Ke = c(!1), V = c(null), pa = c({ x: 0, y: 0 }), U = g(() => Array.isArray(Je.value) && Je.value.length > 0), De = rt, gt = vl();
|
|
56
|
+
Ja(() => {
|
|
57
|
+
gt["chart-background"] && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
|
|
58
|
+
});
|
|
59
|
+
const a = c(ea()), pt = g(() => {
|
|
60
|
+
const e = a.value.style.chart.title.text || "XY chart", t = s.value.end - s.value.start, l = f.value.filter((u) => !p.value.includes(u.absoluteIndex)).length;
|
|
61
|
+
return `${e}. ${l} series. ${t} visible data points.`;
|
|
62
|
+
}), bt = g(() => {
|
|
63
|
+
if (V.value === null) return "";
|
|
64
|
+
const e = V.value + s.value.start, t = a.value.style.chart.grid.x.timeLabels.values.slice(s.value.start, s.value.end)[V.value] ? a.value.style.chart.tooltip.useDefaultTimeFormat ? w.value.slice(s.value.start, s.value.end)[V.value]?.text : Be.value[V.value]?.text : w.value[e]?.text ?? `Point ${e + 1}`, l = f.value.filter((u) => !p.value.includes(u.absoluteIndex)).map((u) => {
|
|
65
|
+
const n = u.series[V.value], i = n?.value ?? n ?? null;
|
|
66
|
+
return `${u.name}: ${i}`;
|
|
67
|
+
}).join(". ");
|
|
68
|
+
return `${t}. ${l}.`;
|
|
69
|
+
}), le = g(() => a.value.userOptions.useCursorPointer), xt = g(() => !!a.value.debug), Lt = g(() => tt({
|
|
70
|
+
defaultConfig: {
|
|
71
|
+
userOptions: { show: !1 },
|
|
72
|
+
table: { show: !1 },
|
|
73
|
+
style: {
|
|
74
|
+
chart: {
|
|
75
|
+
backgroundColor: "#99999930",
|
|
76
|
+
grid: {
|
|
77
|
+
x: {
|
|
78
|
+
axisColor: "#6A6A6A",
|
|
79
|
+
timeLabels: { show: !1 },
|
|
80
|
+
axisName: "",
|
|
81
|
+
horizontalLines: {
|
|
82
|
+
color: "#6A6A6A"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
y: {
|
|
86
|
+
axisColor: "#6A6A6A",
|
|
87
|
+
axisLabels: { show: !1 },
|
|
88
|
+
axisName: "",
|
|
89
|
+
verticalLines: {
|
|
90
|
+
color: "#6A6A6A"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
zeroLine: {
|
|
94
|
+
color: "#6A6A6A"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
legend: {
|
|
98
|
+
backgroundColor: "#99999930"
|
|
99
|
+
},
|
|
100
|
+
paddingProportions: {
|
|
101
|
+
left: 0.05
|
|
102
|
+
},
|
|
103
|
+
scale: {
|
|
104
|
+
max: null,
|
|
105
|
+
min: null
|
|
106
|
+
},
|
|
107
|
+
zoom: {
|
|
108
|
+
endIndex: null,
|
|
109
|
+
startIndex: null
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
userConfig: a.value.skeletonConfig ?? {}
|
|
115
|
+
})), { loading: Oe, FINAL_DATASET: Je } = Dl({
|
|
116
|
+
...cl(D),
|
|
117
|
+
FINAL_CONFIG: a,
|
|
118
|
+
prepareConfig: ea,
|
|
119
|
+
skeletonDataset: D.config?.skeletonDataset ?? [
|
|
120
|
+
{
|
|
121
|
+
name: "",
|
|
122
|
+
series: [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 134],
|
|
123
|
+
type: "line",
|
|
124
|
+
smooth: !0,
|
|
125
|
+
color: "#BABABA"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "",
|
|
129
|
+
series: [0, 0.5, 1, 1.5, 2.5, 4, 6.5, 10.5, 17, 27.5, 44.5, 67],
|
|
130
|
+
type: "bar",
|
|
131
|
+
color: "#AAAAAA"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
skeletonConfig: tt({
|
|
135
|
+
defaultConfig: a.value,
|
|
136
|
+
userConfig: Lt.value
|
|
137
|
+
})
|
|
138
|
+
}), { userOptionsVisible: Qe, setUserOptionsVisibility: ba, keepUserOptionState: xa } = Bl({ config: a.value }), { svgRef: k } = Hl({ config: a.value.style.chart.title });
|
|
139
|
+
function Ct() {
|
|
140
|
+
ba(!0);
|
|
141
|
+
}
|
|
142
|
+
function kt() {
|
|
143
|
+
ba(!1), De("selectX", { seriesIndex: null, datapoint: null }), h.value = null;
|
|
144
|
+
}
|
|
145
|
+
function ea() {
|
|
146
|
+
const e = Ue({
|
|
147
|
+
userConfig: D.config,
|
|
148
|
+
defaultConfig: ft
|
|
149
|
+
});
|
|
150
|
+
let t = {};
|
|
151
|
+
const l = e.theme;
|
|
152
|
+
if (l)
|
|
153
|
+
if (!mt.value(e))
|
|
154
|
+
yt(e), t = e;
|
|
155
|
+
else {
|
|
156
|
+
const u = Ue({
|
|
157
|
+
userConfig: Xl[l] || D.config,
|
|
158
|
+
defaultConfig: e
|
|
159
|
+
});
|
|
160
|
+
t = {
|
|
161
|
+
...Ue({
|
|
162
|
+
userConfig: D.config,
|
|
163
|
+
defaultConfig: u
|
|
164
|
+
}),
|
|
165
|
+
customPalette: e.customPalette.length ? e.customPalette : gl[l] || se
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
else
|
|
169
|
+
t = e;
|
|
170
|
+
return D.config && pl(D.config, "style.chart.grid.y.timeLabels") && (console.warn("VueUiXyCanvas: you are using the deprecated config.style.chart.grid.y.timeLabels. It is recommended to move this configuration to config.style.chart.grid.x.timeLabels."), t.style.chart.grid.x.timeLabels = Ue({
|
|
171
|
+
defaultConfig: t.style.chart.grid.x.timeLabels,
|
|
172
|
+
userConfig: D.config.style.chart.grid.y.timeLabels
|
|
173
|
+
})), t;
|
|
174
|
+
}
|
|
175
|
+
E(() => D.config, (e) => {
|
|
176
|
+
Oe.value || (a.value = ea()), Qe.value = !a.value.userOptions.showOnChartHover, _a(), Ye.value += 1, qe.value += 1, je.value += 1, d.value.showTable = a.value.table.show, d.value.showDataLabels = a.value.style.chart.dataLabels.show, d.value.stacked = a.value.style.chart.stacked, d.value.showTooltip = a.value.style.chart.tooltip.show;
|
|
177
|
+
}, { deep: !0 }), E(() => D.dataset, async (e) => {
|
|
178
|
+
!Array.isArray(e) || e.length === 0 || (await Te(), k.value && !v.value && (v.value = k.value.getContext("2d", { willReadFrequently: !0 })), N.value = !0, X.value = !0, await xe(), Ne(), Ye.value += 1, qe.value += 1, je.value += 1);
|
|
179
|
+
}, { deep: !0 });
|
|
180
|
+
const La = c(a.value.style.chart.aspectRatio), { isPrinting: Ca, isImaging: ka, generatePdf: wa, generateImage: Sa } = El({
|
|
181
|
+
elementId: `xy_canvas_${Z.value}`,
|
|
182
|
+
fileName: a.value.style.chart.title.text || "vue-ui-xy-canvas",
|
|
183
|
+
options: a.value.userOptions.print
|
|
184
|
+
}), d = c({
|
|
185
|
+
showTable: a.value.table.show,
|
|
186
|
+
showDataLabels: a.value.style.chart.dataLabels.show,
|
|
187
|
+
stacked: a.value.style.chart.stacked,
|
|
188
|
+
showTooltip: a.value.style.chart.tooltip.show
|
|
189
|
+
});
|
|
190
|
+
function za(e) {
|
|
191
|
+
me.value = e, da.value += 1;
|
|
192
|
+
}
|
|
193
|
+
const Ta = g(() => bl(a.value.customPalette)), aa = g(() => p.value.length === M.value.length), O = g(() => M.value ? Math.max(...M.value.filter((e, t) => aa.value ? !0 : !p.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0);
|
|
194
|
+
function wt(e) {
|
|
195
|
+
$.value = e, J();
|
|
196
|
+
}
|
|
197
|
+
const $a = c(0), pe = c(0);
|
|
198
|
+
function St() {
|
|
199
|
+
if (!v.value || !a.value.style.chart.grid.x.timeLabels.show) return 0;
|
|
200
|
+
const e = w.value || [], t = s.value.start ?? 0, l = s.value.end ?? 0;
|
|
201
|
+
if (!Math.max(0, l - t)) return 0;
|
|
202
|
+
const n = Math.round(
|
|
203
|
+
y.value / 40 * a.value.style.chart.grid.x.timeLabels.fontSizeRatio
|
|
204
|
+
), i = `${a.value.style.chart.grid.x.timeLabels.bold ? "bold " : ""}${n}px ${a.value.style.fontFamily}`;
|
|
205
|
+
v.value.save(), v.value.font = i;
|
|
206
|
+
let r = 0;
|
|
207
|
+
for (let Y = t; Y < l; Y += 1) {
|
|
208
|
+
const B = e[Y]?.text ?? `${Y + 1}`, _e = v.value.measureText(String(B));
|
|
209
|
+
_e.width > r && (r = _e.width);
|
|
210
|
+
}
|
|
211
|
+
v.value.restore();
|
|
212
|
+
const L = (a.value.style.chart.grid.x.timeLabels.rotation || 0) * Math.PI / 180, x = n, S = Math.abs(Math.sin(L)) * r + Math.abs(Math.cos(L)) * x, R = a.value.style.chart.grid.x.timeLabels.offsetY || 1, oe = y.value / R;
|
|
213
|
+
return Math.max(0, oe + S + 4);
|
|
214
|
+
}
|
|
215
|
+
function zt() {
|
|
216
|
+
$a.value = St();
|
|
217
|
+
}
|
|
218
|
+
function Tt() {
|
|
219
|
+
pe.value && cancelAnimationFrame(pe.value), pe.value = requestAnimationFrame(() => {
|
|
220
|
+
requestAnimationFrame(() => {
|
|
221
|
+
zt();
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
sa(() => {
|
|
226
|
+
pe.value && cancelAnimationFrame(pe.value);
|
|
227
|
+
});
|
|
228
|
+
const o = g(() => {
|
|
229
|
+
const e = y.value - y.value * (a.value.style.chart.paddingProportions.left + a.value.style.chart.paddingProportions.right), t = ee.value * a.value.style.chart.paddingProportions.top, l = ee.value * a.value.style.chart.paddingProportions.bottom, u = $a.value, n = ee.value - l - u, i = ee.value - (t + l) - u;
|
|
230
|
+
return {
|
|
231
|
+
canvasWidth: y.value,
|
|
232
|
+
canvasHeight: ee.value,
|
|
233
|
+
left: y.value * a.value.style.chart.paddingProportions.left,
|
|
234
|
+
top: t,
|
|
235
|
+
right: y.value - y.value * a.value.style.chart.paddingProportions.right,
|
|
236
|
+
bottom: n,
|
|
237
|
+
width: e,
|
|
238
|
+
height: i,
|
|
239
|
+
slot: e / (s.value.end - s.value.start)
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
function Aa(e, t) {
|
|
243
|
+
return e / t;
|
|
244
|
+
}
|
|
245
|
+
function $t({ hasAutoScale: e, series: t, min: l, max: u, scale: n, yOffset: i, individualHeight: r, stackIndex: m = null }) {
|
|
246
|
+
return t.map((L, x) => {
|
|
247
|
+
const S = n.min < 0 ? Math.abs(n.min) : 0, R = Aa(L + S, S + n.max);
|
|
248
|
+
let oe, Y;
|
|
249
|
+
e && (oe = n.min, Y = Aa(L - oe, n.max - oe));
|
|
250
|
+
let B = 0;
|
|
251
|
+
return m === null ? B = o.value.bottom - o.value.height * (e ? Y : R) : B = o.value.bottom - i - r * (e ? Y : R), {
|
|
252
|
+
x: o.value.left + o.value.slot * x + o.value.slot / 2,
|
|
253
|
+
y: B,
|
|
254
|
+
value: L
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
const A = g(() => {
|
|
259
|
+
const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...M.value.filter((r, m) => !p.value.includes(r.absoluteIndex)).flatMap((r) => r.series.slice(s.value.start, s.value.end))), t = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...M.value.filter((r, m) => !p.value.includes(r.absoluteIndex)).flatMap((r) => r.series.slice(s.value.start, s.value.end))), l = ra(e < 0 ? e : 0, t === e ? e + 1 < 0 ? 0 : e + 1 : t < 0 ? 0 : t, a.value.style.chart.scale.ticks), u = l.min < 0 ? Math.abs(l.min) : 0, n = o.value.bottom - o.value.height * (u / (l.max + u)), i = l.ticks.map((r) => ({
|
|
260
|
+
y: o.value.bottom - o.value.height * ((r + u) / (l.max + u)),
|
|
261
|
+
x: o.value.left - 8,
|
|
262
|
+
value: r
|
|
263
|
+
}));
|
|
264
|
+
return {
|
|
265
|
+
absoluteMin: u,
|
|
266
|
+
max: t,
|
|
267
|
+
min: e,
|
|
268
|
+
scale: l,
|
|
269
|
+
yLabels: i,
|
|
270
|
+
zero: n
|
|
271
|
+
};
|
|
272
|
+
}), Ia = g(() => f.value.map((e) => `
|
|
273
|
+
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
274
|
+
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
275
|
+
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
276
|
+
</svg>
|
|
277
|
+
<span>${e.name ? e.name + ": " : ""}</span>
|
|
278
|
+
<span>${ce(
|
|
279
|
+
a.value.style.chart.dataLabels.formatter,
|
|
280
|
+
e.series[h.value] ?? "-",
|
|
281
|
+
de({
|
|
282
|
+
p: e.prefix || "",
|
|
283
|
+
v: e.series[h.value] ?? "-",
|
|
284
|
+
s: e.suffix || "",
|
|
285
|
+
r: e.rounding || 0
|
|
286
|
+
}),
|
|
287
|
+
{ datapoint: e, seriesIndex: h.value }
|
|
288
|
+
)}</span>
|
|
289
|
+
</div>
|
|
290
|
+
`)), Ee = g(() => a.value.style.chart.line.cutNullValues), M = g(() => Je.value.map((e, t) => ({
|
|
291
|
+
...e,
|
|
292
|
+
series: xl({
|
|
293
|
+
data: Ll(e.series, [], Ee.value),
|
|
294
|
+
threshold: a.value.downsample.threshold
|
|
295
|
+
}),
|
|
296
|
+
absoluteIndex: t,
|
|
297
|
+
color: lt(e.color || Ta.value[t] || se[t] || se[t % se.length])
|
|
298
|
+
}))), At = g(() => {
|
|
299
|
+
if (!a.value.style.chart.zoom.minimap.show) return [];
|
|
300
|
+
const e = M.value.filter((n) => !p.value.includes(n.absoluteIndex)), t = Math.max(...e.map((n) => n.series.length)), l = [];
|
|
301
|
+
for (let n = 0; n < t; n += 1)
|
|
302
|
+
l.push(e.map((i) => i.series[n] || 0).reduce((i, r) => (i || 0) + (r || 0), 0));
|
|
303
|
+
const u = Math.min(...l);
|
|
304
|
+
return l.map((n) => n + (u < 0 ? Math.abs(u) : 0));
|
|
305
|
+
}), It = g(() => a.value.style.chart.zoom.minimap.show ? M.value.map((t) => ({
|
|
306
|
+
...t,
|
|
307
|
+
isVisible: !p.value.includes(t.absoluteIndex)
|
|
308
|
+
})) : []);
|
|
309
|
+
E(O, (e) => {
|
|
310
|
+
e && xe();
|
|
311
|
+
});
|
|
312
|
+
const f = g(() => Cl(M.value.filter((e, t) => !p.value.includes(e.absoluteIndex))).map((e, t) => ({
|
|
313
|
+
...e,
|
|
314
|
+
series: e.series.slice(s.value.start, s.value.end)
|
|
315
|
+
})).map((e, t) => {
|
|
316
|
+
let l = [null, void 0].includes(e.scaleMin) ? Math.min(...e.series) || 0 : e.scaleMin, u = [null, void 0].includes(e.scaleMax) ? Math.max(...e.series) || 1 : e.scaleMax;
|
|
317
|
+
l === u && (l = l >= 0 ? u - 1 : l, u = u >= 0 ? u : l + 1), e.series.filter((B) => ![null, void 0].includes(B)).map((B) => (B - l) / (u - l));
|
|
318
|
+
const n = {
|
|
319
|
+
valueMin: l,
|
|
320
|
+
valueMax: u
|
|
321
|
+
}, i = e.scaleSteps || a.value.style.chart.scale.ticks;
|
|
322
|
+
let r;
|
|
323
|
+
e.autoScaling ? r = ra(n.valueMin, n.valueMax, i) : r = ra(n.valueMin < 0 ? n.valueMin : 0, n.valueMax <= 0 ? 0 : n.valueMax, i);
|
|
324
|
+
const m = d.value.stacked ? o.value.height * (1 - e.cumulatedStackRatio) : 0, L = d.value.stacked ? o.value.height / a.value.style.chart.stackGap : 0, x = d.value.stacked ? o.value.height * e.stackRatio - L : o.value.height, S = r.min < 0 ? Math.abs(r.min) : 0;
|
|
325
|
+
let R;
|
|
326
|
+
e.autoScaling && d.value.stacked && u <= 0 ? R = o.value.bottom - m - x : R = o.value.bottom - m - x * (S / (r.max + S));
|
|
327
|
+
const oe = r.ticks.map((B, _e) => ({
|
|
328
|
+
y: o.value.bottom - m - x * (_e / (r.ticks.length - 1)),
|
|
329
|
+
x: o.value.left - 8,
|
|
330
|
+
value: B
|
|
331
|
+
})), Y = $t({
|
|
332
|
+
hasAutoScale: d.value.stacked && e.autoScaling,
|
|
333
|
+
series: e.series,
|
|
334
|
+
min: d.value.stacked ? l : A.value.min,
|
|
335
|
+
max: d.value.stacked ? u : A.value.max,
|
|
336
|
+
scale: d.value.stacked ? r : A.value.scale,
|
|
337
|
+
yOffset: m,
|
|
338
|
+
individualHeight: x,
|
|
339
|
+
stackIndex: d.value.stacked ? t : null
|
|
340
|
+
});
|
|
341
|
+
return {
|
|
342
|
+
...e,
|
|
343
|
+
coordinatesLine: Y,
|
|
344
|
+
min: l,
|
|
345
|
+
max: u,
|
|
346
|
+
localScale: r,
|
|
347
|
+
localZero: R,
|
|
348
|
+
localMin: S,
|
|
349
|
+
localYLabels: oe,
|
|
350
|
+
yOffset: m,
|
|
351
|
+
individualHeight: x
|
|
352
|
+
};
|
|
353
|
+
})), s = c({
|
|
354
|
+
start: 0,
|
|
355
|
+
end: O.value
|
|
356
|
+
}), F = c({ start: 0, end: O.value }), be = c(null);
|
|
357
|
+
function Mt() {
|
|
358
|
+
return new Promise((e) => requestAnimationFrame(
|
|
359
|
+
() => requestAnimationFrame(() => e())
|
|
360
|
+
));
|
|
361
|
+
}
|
|
362
|
+
sa(() => {
|
|
363
|
+
be.value && cancelAnimationFrame(be.value);
|
|
364
|
+
});
|
|
365
|
+
async function xe() {
|
|
366
|
+
Fa(), await Te(), be.value && cancelAnimationFrame(be.value), be.value = requestAnimationFrame(async () => {
|
|
367
|
+
await Mt(), Fa();
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
const Ft = g(() => a.value.style.chart.zoom.preview.enable && (F.value.start !== s.value.start || F.value.end !== s.value.end));
|
|
371
|
+
function Ma(e, t) {
|
|
372
|
+
F.value[e] = t;
|
|
373
|
+
}
|
|
374
|
+
async function Fa() {
|
|
375
|
+
if (!ge.value) {
|
|
376
|
+
ge.value = !0;
|
|
377
|
+
try {
|
|
378
|
+
const { startIndex: e, endIndex: t } = a.value.style.chart.zoom, l = Math.max(...M.value.map((i) => i.series.length)), u = e ?? 0, n = t != null ? Math.min(Pa(t + 1), l) : l;
|
|
379
|
+
Pe.value = !0, s.value.start = u, s.value.end = n, F.value.start = u, F.value.end = n, ta(), ga.value = !0, await Te(), ae.value && (ae.value.setStartValue(s.value.start), ae.value.setEndValue(s.value.end));
|
|
380
|
+
} finally {
|
|
381
|
+
queueMicrotask(() => {
|
|
382
|
+
Pe.value = !1;
|
|
383
|
+
}), ge.value = !1;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function Pt(e) {
|
|
388
|
+
ge.value || Pe.value || e !== s.value.start && (s.value.start = e, F.value.start = e, ta());
|
|
389
|
+
}
|
|
390
|
+
function Rt(e) {
|
|
391
|
+
if (ge.value || Pe.value) return;
|
|
392
|
+
const t = Pa(e);
|
|
393
|
+
t !== s.value.end && (s.value.end = t, F.value.end = t, ta());
|
|
394
|
+
}
|
|
395
|
+
function Pa(e) {
|
|
396
|
+
const t = O.value;
|
|
397
|
+
return e > t ? t : e < 0 || e < s.value.start ? a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex + 1 : 1 : e;
|
|
398
|
+
}
|
|
399
|
+
function ta() {
|
|
400
|
+
const e = Math.max(
|
|
401
|
+
1,
|
|
402
|
+
Math.max(...M.value.map((u) => u.series.length))
|
|
403
|
+
);
|
|
404
|
+
let t = Math.max(0, Math.min(s.value.start ?? 0, e - 1)), l = Math.max(t + 1, Math.min(s.value.end ?? e, e));
|
|
405
|
+
(!Number.isFinite(t) || !Number.isFinite(l) || l <= t) && (t = 0, l = e), s.value = { start: t, end: l }, F.value.start = t, F.value.end = l, ae.value && (ae.value.setStartValue(t), ae.value.setEndValue(l));
|
|
406
|
+
}
|
|
407
|
+
const Dt = g(() => f.value.filter((e) => ["line", "plot", void 0].includes(e.type))), P = g(() => f.value.filter((e) => e.type === "bar"));
|
|
408
|
+
function Ne() {
|
|
409
|
+
if (!k.value || !ue.value) return;
|
|
410
|
+
const e = ue.value.offsetWidth, t = ue.value.offsetHeight;
|
|
411
|
+
k.value.width = e * ne.value * 2, k.value.height = t * ne.value * 2, y.value = e * ne.value * 2, ee.value = t * ne.value * 2, v.value?.scale(ne.value, ne.value), J();
|
|
412
|
+
}
|
|
413
|
+
E(U, async (e) => {
|
|
414
|
+
if (!e) {
|
|
415
|
+
Fe.value = null, he.value = !1, h.value = null, _.value = null;
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
await Te(), k.value && !v.value && (v.value = k.value.getContext("2d", { willReadFrequently: !0 })), N.value = !0, X.value = !0, await xe(), Ne(), J();
|
|
419
|
+
});
|
|
420
|
+
function Ot() {
|
|
421
|
+
if (v.value && (v.value.clearRect(0, 0, 1e4, 1e4), v.value.fillStyle = a.value.style.chart.backgroundColor, v.value.fillRect(0, 0, o.value.canvasWidth, o.value.canvasHeight), !!U.value)) {
|
|
422
|
+
if (d.value.stacked)
|
|
423
|
+
a.value.style.chart.grid.y.verticalLines.show && s.value.end - s.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength ? f.value.forEach((e) => {
|
|
424
|
+
for (let t = 0; t < s.value.end - s.value.start + 1; t += 1)
|
|
425
|
+
T(
|
|
426
|
+
v.value,
|
|
427
|
+
[
|
|
428
|
+
{
|
|
429
|
+
x: o.value.left + o.value.slot * t,
|
|
430
|
+
y: o.value.bottom - e.yOffset - e.individualHeight
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
x: o.value.left + o.value.slot * t,
|
|
434
|
+
y: o.value.bottom - e.yOffset
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
{
|
|
438
|
+
color: a.value.style.chart.grid.y.verticalLines.color
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
}) : a.value.style.chart.grid.y.verticalLines.show && s.value.end - s.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength && f.value.forEach((e) => {
|
|
442
|
+
for (let t = s.value.start; t < s.value.end; t += 1)
|
|
443
|
+
t % Math.floor((s.value.end - s.value.start) / a.value.style.chart.grid.x.timeLabels.modulo) === 0 && T(
|
|
444
|
+
v.value,
|
|
445
|
+
[
|
|
446
|
+
{
|
|
447
|
+
x: o.value.left + o.value.slot * (t - s.value.start) + o.value.slot / 2,
|
|
448
|
+
y: o.value.bottom - e.yOffset - e.individualHeight
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
x: o.value.left + o.value.slot * (t - s.value.start) + o.value.slot / 2,
|
|
452
|
+
y: o.value.bottom - e.yOffset
|
|
453
|
+
}
|
|
454
|
+
],
|
|
455
|
+
{
|
|
456
|
+
color: a.value.style.chart.grid.y.verticalLines.color
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
}), a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? f.value.forEach((e) => {
|
|
460
|
+
e.localYLabels.forEach((t, l) => {
|
|
461
|
+
l < e.localYLabels.length - 1 && Ve(
|
|
462
|
+
v.value,
|
|
463
|
+
[
|
|
464
|
+
{ x: o.value.left, y: t.y },
|
|
465
|
+
{ x: o.value.right, y: t.y },
|
|
466
|
+
{ x: o.value.right, y: e.localYLabels[l + 1].y },
|
|
467
|
+
{ x: o.value.left, y: e.localYLabels[l + 1].y }
|
|
468
|
+
],
|
|
469
|
+
{
|
|
470
|
+
fillColor: l % 2 === 0 ? "transparent" : Ie(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
|
|
471
|
+
strokeColor: "transparent"
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
});
|
|
475
|
+
}) : f.value.forEach((e) => {
|
|
476
|
+
e.localYLabels.slice(s.value.start, s.value.end).forEach((t) => {
|
|
477
|
+
T(
|
|
478
|
+
v.value,
|
|
479
|
+
[
|
|
480
|
+
{ x: o.value.left, y: t.y },
|
|
481
|
+
{ x: o.value.right, y: t.y }
|
|
482
|
+
],
|
|
483
|
+
{
|
|
484
|
+
color: a.value.style.chart.grid.x.horizontalLines.color
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
});
|
|
488
|
+
})), a.value.style.chart.grid.zeroLine.show && f.value.forEach((e) => {
|
|
489
|
+
T(
|
|
490
|
+
v.value,
|
|
491
|
+
[
|
|
492
|
+
{ x: o.value.left, y: e.localZero },
|
|
493
|
+
{ x: o.value.right, y: e.localZero }
|
|
494
|
+
],
|
|
495
|
+
{
|
|
496
|
+
color: a.value.style.chart.grid.zeroLine.color,
|
|
497
|
+
lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
}), a.value.style.chart.grid.y.axisLabels.show && f.value.forEach((e) => {
|
|
501
|
+
T(
|
|
502
|
+
v.value,
|
|
503
|
+
[
|
|
504
|
+
{ x: o.value.left, y: o.value.bottom - e.yOffset },
|
|
505
|
+
{ x: o.value.left, y: o.value.bottom - e.yOffset - e.individualHeight }
|
|
506
|
+
],
|
|
507
|
+
{
|
|
508
|
+
color: e.color
|
|
509
|
+
}
|
|
510
|
+
), T(
|
|
511
|
+
v.value,
|
|
512
|
+
[
|
|
513
|
+
{ x: o.value.right, y: o.value.bottom - e.yOffset },
|
|
514
|
+
{ x: o.value.right, y: o.value.bottom - e.yOffset - e.individualHeight }
|
|
515
|
+
],
|
|
516
|
+
{
|
|
517
|
+
color: e.color
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}), f.value.forEach((e) => {
|
|
521
|
+
Q(
|
|
522
|
+
v.value,
|
|
523
|
+
e.name,
|
|
524
|
+
y.value / 35,
|
|
525
|
+
o.value.bottom - e.yOffset - e.individualHeight / 2,
|
|
526
|
+
{
|
|
527
|
+
align: "center",
|
|
528
|
+
rotation: -90,
|
|
529
|
+
color: e.color,
|
|
530
|
+
font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`
|
|
531
|
+
}
|
|
532
|
+
);
|
|
533
|
+
});
|
|
534
|
+
else {
|
|
535
|
+
if (a.value.style.chart.grid.y.verticalLines.show && s.value.end - s.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
|
|
536
|
+
for (let e = 0; e < s.value.end - s.value.start + 1; e += 1)
|
|
537
|
+
T(
|
|
538
|
+
v.value,
|
|
539
|
+
[
|
|
540
|
+
{ x: o.value.left + o.value.slot * e, y: o.value.top },
|
|
541
|
+
{ x: o.value.left + o.value.slot * e, y: o.value.bottom }
|
|
542
|
+
],
|
|
543
|
+
{
|
|
544
|
+
color: a.value.style.chart.grid.y.verticalLines.color
|
|
545
|
+
}
|
|
546
|
+
);
|
|
547
|
+
else if (a.value.style.chart.grid.y.verticalLines.show && s.value.end - s.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
|
|
548
|
+
for (let e = s.value.start; e < s.value.end; e += 1)
|
|
549
|
+
e % Math.floor((s.value.end - s.value.start) / a.value.style.chart.grid.x.timeLabels.modulo) === 0 && T(
|
|
550
|
+
v.value,
|
|
551
|
+
[
|
|
552
|
+
{ x: o.value.left + o.value.slot * (e - s.value.start) + o.value.slot / 2, y: o.value.top },
|
|
553
|
+
{ x: o.value.left + o.value.slot * (e - s.value.start) + o.value.slot / 2, y: o.value.bottom }
|
|
554
|
+
],
|
|
555
|
+
{
|
|
556
|
+
color: a.value.style.chart.grid.y.verticalLines.color
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? A.value.yLabels.forEach((e, t) => {
|
|
560
|
+
t < A.value.yLabels.length - 1 && Ve(
|
|
561
|
+
v.value,
|
|
562
|
+
[
|
|
563
|
+
{ x: o.value.left, y: e.y },
|
|
564
|
+
{ x: o.value.right, y: e.y },
|
|
565
|
+
{ x: o.value.right, y: A.value.yLabels[t + 1].y },
|
|
566
|
+
{ x: o.value.left, y: A.value.yLabels[t + 1].y }
|
|
567
|
+
],
|
|
568
|
+
{
|
|
569
|
+
fillColor: t % 2 === 0 ? "transparent" : Ie(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
|
|
570
|
+
strokeColor: "transparent"
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
}) : A.value.yLabels.forEach((e) => {
|
|
574
|
+
T(
|
|
575
|
+
v.value,
|
|
576
|
+
[
|
|
577
|
+
{ x: o.value.left, y: e.y },
|
|
578
|
+
{ x: o.value.right, y: e.y }
|
|
579
|
+
],
|
|
580
|
+
{
|
|
581
|
+
color: a.value.style.chart.grid.x.horizontalLines.color
|
|
582
|
+
}
|
|
583
|
+
);
|
|
584
|
+
})), a.value.style.chart.grid.y.showAxis && T(
|
|
585
|
+
v.value,
|
|
586
|
+
[
|
|
587
|
+
{ x: o.value.left, y: o.value.top },
|
|
588
|
+
{ x: o.value.left, y: o.value.bottom }
|
|
589
|
+
],
|
|
590
|
+
{
|
|
591
|
+
color: a.value.style.chart.grid.y.axisColor,
|
|
592
|
+
lineWidth: a.value.style.chart.grid.y.axisThickness
|
|
593
|
+
}
|
|
594
|
+
), a.value.style.chart.grid.x.showAxis && T(
|
|
595
|
+
v.value,
|
|
596
|
+
[
|
|
597
|
+
{ x: o.value.left, y: o.value.bottom },
|
|
598
|
+
{ x: o.value.right, y: o.value.bottom }
|
|
599
|
+
],
|
|
600
|
+
{
|
|
601
|
+
color: a.value.style.chart.grid.x.axisColor,
|
|
602
|
+
lineWidth: a.value.style.chart.grid.x.axisThickness
|
|
603
|
+
}
|
|
604
|
+
), a.value.style.chart.grid.zeroLine.show && T(
|
|
605
|
+
v.value,
|
|
606
|
+
[
|
|
607
|
+
{ x: o.value.left, y: A.value.zero },
|
|
608
|
+
{ x: o.value.right, y: A.value.zero }
|
|
609
|
+
],
|
|
610
|
+
{
|
|
611
|
+
color: a.value.style.chart.grid.zeroLine.color,
|
|
612
|
+
lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
a.value.style.chart.grid.y.axisName && Q(
|
|
617
|
+
v.value,
|
|
618
|
+
a.value.style.chart.grid.y.axisName,
|
|
619
|
+
y.value - y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio * 1.2,
|
|
620
|
+
o.value.bottom - o.value.height / 2,
|
|
621
|
+
{
|
|
622
|
+
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
623
|
+
color: a.value.style.chart.color,
|
|
624
|
+
align: "center",
|
|
625
|
+
rotation: 90
|
|
626
|
+
}
|
|
627
|
+
), a.value.style.chart.grid.x.axisName && Q(
|
|
628
|
+
v.value,
|
|
629
|
+
a.value.style.chart.grid.x.axisName,
|
|
630
|
+
y.value / 2,
|
|
631
|
+
ee.value,
|
|
632
|
+
{
|
|
633
|
+
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
634
|
+
color: a.value.style.chart.color,
|
|
635
|
+
align: "center"
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function Et(e) {
|
|
641
|
+
for (let t = 0; t < e.coordinatesLine.length; t += 1) {
|
|
642
|
+
const l = (h.value === t || $.value === t ? y.value / 150 : a.value.style.chart.line.plots.show || e.type === "plot" ? y.value / 200 : 0) * a.value.style.chart.line.plots.radiusRatio;
|
|
643
|
+
va(
|
|
644
|
+
v.value,
|
|
645
|
+
{ x: e.coordinatesLine[t].x, y: e.coordinatesLine[t].y },
|
|
646
|
+
l,
|
|
647
|
+
{
|
|
648
|
+
color: a.value.style.chart.backgroundColor,
|
|
649
|
+
fillStyle: e.color
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
function Nt() {
|
|
655
|
+
f.value.forEach((e) => {
|
|
656
|
+
e.showYMarker && Ce(e) && Q(
|
|
657
|
+
v.value,
|
|
658
|
+
ce(
|
|
659
|
+
a.value.style.chart.dataLabels.formatter,
|
|
660
|
+
Ce(e).value,
|
|
661
|
+
de({
|
|
662
|
+
p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
663
|
+
v: Ce(e).value,
|
|
664
|
+
s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
665
|
+
r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
666
|
+
}),
|
|
667
|
+
{ datapoint: Ce(e), seriesIndex: null }
|
|
668
|
+
),
|
|
669
|
+
o.value.left - 8 + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
670
|
+
Ce(e).y,
|
|
671
|
+
{
|
|
672
|
+
align: "right",
|
|
673
|
+
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
674
|
+
color: e.color
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
function Bt() {
|
|
680
|
+
a.value.style.chart.grid.y.axisLabels.show && (d.value.stacked ? f.value.forEach((e) => {
|
|
681
|
+
e.localYLabels.forEach((t, l) => {
|
|
682
|
+
Q(
|
|
683
|
+
v.value,
|
|
684
|
+
ce(
|
|
685
|
+
a.value.style.chart.dataLabels.formatter,
|
|
686
|
+
t.value,
|
|
687
|
+
de({
|
|
688
|
+
p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
689
|
+
v: t.value,
|
|
690
|
+
s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
691
|
+
r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
692
|
+
}),
|
|
693
|
+
{ datapoint: t, seriesIndex: l }
|
|
694
|
+
),
|
|
695
|
+
t.x + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
696
|
+
t.y,
|
|
697
|
+
{
|
|
698
|
+
align: "right",
|
|
699
|
+
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
700
|
+
color: e.color,
|
|
701
|
+
globalAlpha: e.showYMarker && ![null, void 0].includes(h.value ?? $.value) ? 0.2 : 1
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
});
|
|
705
|
+
}) : A.value.yLabels.forEach((e, t) => {
|
|
706
|
+
Q(
|
|
707
|
+
v.value,
|
|
708
|
+
ce(
|
|
709
|
+
a.value.style.chart.dataLabels.formatter,
|
|
710
|
+
e.value,
|
|
711
|
+
de({
|
|
712
|
+
p: a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
713
|
+
v: e.value,
|
|
714
|
+
s: a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
715
|
+
r: a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
716
|
+
}),
|
|
717
|
+
{ datapoint: e, seriesIndex: t }
|
|
718
|
+
),
|
|
719
|
+
e.x + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
720
|
+
e.y,
|
|
721
|
+
{
|
|
722
|
+
align: "right",
|
|
723
|
+
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
724
|
+
color: a.value.style.chart.grid.y.axisLabels.color,
|
|
725
|
+
globalAlpha: f.value.some((l) => l.showYMarker) && ![null, void 0].includes(h.value ?? $.value) ? 0.2 : 1
|
|
726
|
+
}
|
|
727
|
+
);
|
|
728
|
+
}));
|
|
729
|
+
}
|
|
730
|
+
function Ht(e) {
|
|
731
|
+
for (let t = 0; t < e.coordinatesLine.length; t += 1)
|
|
732
|
+
Q(
|
|
733
|
+
v.value,
|
|
734
|
+
ce(
|
|
735
|
+
a.value.style.chart.dataLabels.formatter,
|
|
736
|
+
e.coordinatesLine[t].value,
|
|
737
|
+
de({
|
|
738
|
+
p: e.prefix || "",
|
|
739
|
+
v: e.coordinatesLine[t].value,
|
|
740
|
+
s: e.suffix || "",
|
|
741
|
+
r: e.rounding || 0
|
|
742
|
+
}),
|
|
743
|
+
{ datapoint: e.coordinatesLine[t], seriesIndex: t }
|
|
744
|
+
),
|
|
745
|
+
e.coordinatesLine[t].x,
|
|
746
|
+
e.coordinatesLine[t].y + a.value.style.chart.dataLabels.offsetY,
|
|
747
|
+
{
|
|
748
|
+
align: "center",
|
|
749
|
+
font: `${a.value.style.chart.dataLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
750
|
+
color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
|
|
751
|
+
strokeColor: a.value.style.chart.backgroundColor,
|
|
752
|
+
lineWidth: 0.5
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
const w = c([]);
|
|
757
|
+
let Ra = 0;
|
|
758
|
+
ua(() => {
|
|
759
|
+
const e = ++Ra;
|
|
760
|
+
(async () => {
|
|
761
|
+
const t = await Fl({
|
|
762
|
+
values: a.value.style.chart.grid.x.timeLabels.values,
|
|
763
|
+
maxDatapoints: O.value,
|
|
764
|
+
formatter: a.value.style.chart.grid.x.timeLabels.datetimeFormatter,
|
|
765
|
+
start: 0,
|
|
766
|
+
end: O.value
|
|
767
|
+
});
|
|
768
|
+
e === Ra && (w.value = t);
|
|
769
|
+
})();
|
|
770
|
+
}), ua(() => {
|
|
771
|
+
a.value.style.chart.grid.x.timeLabels.show, a.value.style.chart.grid.x.timeLabels.rotation, a.value.style.chart.grid.x.timeLabels.offsetY, a.value.style.chart.grid.x.timeLabels.fontSizeRatio, a.value.style.chart.grid.x.timeLabels.bold, s.value.start, s.value.end, y.value, ee.value, (w.value || []).map((e) => e?.text ?? "").join("|"), Tt();
|
|
772
|
+
}, { flush: "post" });
|
|
773
|
+
const Da = c({ months: [], shortMonths: [], days: [], shortDays: [] });
|
|
774
|
+
let Oa = 0;
|
|
775
|
+
ua(() => {
|
|
776
|
+
const e = ++Oa, t = a.value.style.chart.grid.x.timeLabels.datetimeFormatter;
|
|
777
|
+
(async () => {
|
|
778
|
+
const l = await ut(t.locale).catch(() => ut("en"));
|
|
779
|
+
e === Oa && (Da.value = l.data);
|
|
780
|
+
})();
|
|
781
|
+
});
|
|
782
|
+
const Ea = g(() => {
|
|
783
|
+
const e = a.value.style.chart.grid.x.timeLabels.datetimeFormatter, t = Pl({
|
|
784
|
+
useUTC: e.useUTC,
|
|
785
|
+
locale: Da.value,
|
|
786
|
+
januaryAsYear: e.januaryAsYear
|
|
787
|
+
});
|
|
788
|
+
return (l, u) => {
|
|
789
|
+
const i = a.value.style.chart.grid.x.timeLabels.values?.[l];
|
|
790
|
+
return i == null ? "" : t.formatDate(new Date(i), u);
|
|
791
|
+
};
|
|
792
|
+
}), Na = g(() => (a.value.style.chart.grid.x.timeLabels.values || []).map((t, l) => ({
|
|
793
|
+
text: Ea.value(l, a.value.style.chart.zoom.timeFormat),
|
|
794
|
+
absoluteIndex: l
|
|
795
|
+
}))), Be = g(() => (a.value.style.chart.grid.x.timeLabels.values || []).map((t, l) => ({
|
|
796
|
+
text: Ea.value(l, a.value.style.chart.tooltip.timeFormat),
|
|
797
|
+
absoluteIndex: l
|
|
798
|
+
})));
|
|
799
|
+
function Wt() {
|
|
800
|
+
for (let e = s.value.start; e < s.value.end; e += 1)
|
|
801
|
+
(s.value.end - s.value.start < a.value.style.chart.grid.x.timeLabels.modulo || s.value.end - s.value.start >= a.value.style.chart.grid.x.timeLabels.modulo && (e % Math.floor((s.value.end - s.value.start) / a.value.style.chart.grid.x.timeLabels.modulo) === 0 || (e === h.value + s.value.start || e === $.value) && a.value.style.chart.grid.x.timeLabels.showMarker)) && Q(
|
|
802
|
+
v.value,
|
|
803
|
+
w.value[e] ? w.value[e].text : e + 1,
|
|
804
|
+
o.value.left + o.value.slot * (e - s.value.start) + o.value.slot / 2,
|
|
805
|
+
o.value.bottom + y.value / a.value.style.chart.grid.x.timeLabels.offsetY,
|
|
806
|
+
{
|
|
807
|
+
align: a.value.style.chart.grid.x.timeLabels.rotation === 0 ? "center" : a.value.style.chart.grid.x.timeLabels.rotation > 0 ? "left" : "right",
|
|
808
|
+
font: `${a.value.style.chart.grid.x.timeLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.x.timeLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
809
|
+
color: a.value.style.chart.grid.x.timeLabels.showMarker ? Ie(a.value.style.chart.grid.x.timeLabels.color, h.value !== null || $.value !== null ? h.value + s.value.start === e || $.value === e ? 100 : 20 : 100) : a.value.style.chart.grid.x.timeLabels.color,
|
|
810
|
+
rotation: a.value.style.chart.grid.x.timeLabels.rotation
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
function Ba() {
|
|
815
|
+
T(
|
|
816
|
+
v.value,
|
|
817
|
+
[
|
|
818
|
+
{ x: o.value.left + o.value.slot * (h.value ?? $.value) + o.value.slot / 2, y: o.value.top },
|
|
819
|
+
{ x: o.value.left + o.value.slot * (h.value ?? $.value) + o.value.slot / 2, y: o.value.bottom }
|
|
820
|
+
],
|
|
821
|
+
{
|
|
822
|
+
color: a.value.style.chart.selector.color,
|
|
823
|
+
lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
|
|
824
|
+
lineWidth: 2
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
function Xt() {
|
|
829
|
+
_.value && T(
|
|
830
|
+
v.value,
|
|
831
|
+
[
|
|
832
|
+
{ x: o.value.left, y: _.value },
|
|
833
|
+
{ x: o.value.right, y: _.value }
|
|
834
|
+
],
|
|
835
|
+
{
|
|
836
|
+
color: a.value.style.chart.selector.color,
|
|
837
|
+
lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
|
|
838
|
+
lineWidth: 2
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
function _t() {
|
|
843
|
+
P.value.forEach((e, t) => {
|
|
844
|
+
for (let l = 0; l < e.coordinatesLine.length; l += 1)
|
|
845
|
+
Ve(
|
|
846
|
+
v.value,
|
|
847
|
+
[
|
|
848
|
+
{
|
|
849
|
+
x: o.value.left + o.value.slot * l + o.value.slot / 10 + (d.value.stacked ? 0 : o.value.slot / P.value.length * t - (t === 0 ? 0 : o.value.slot / (5 * P.value.length) * t)),
|
|
850
|
+
y: d.value.stacked ? e.localZero : A.value.zero
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
x: o.value.left + o.value.slot * l + o.value.slot / 10 + (d.value.stacked ? 0 : o.value.slot / P.value.length * t - (t === 0 ? 0 : o.value.slot / (5 * P.value.length) * t)) + o.value.slot * 0.8 / (d.value.stacked ? 1 : P.value.length),
|
|
854
|
+
y: d.value.stacked ? e.localZero : A.value.zero
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
x: o.value.left + o.value.slot * l + o.value.slot / 10 + (d.value.stacked ? 0 : o.value.slot / P.value.length * t - (t === 0 ? 0 : o.value.slot / (5 * P.value.length) * t)) + o.value.slot * 0.8 / (d.value.stacked ? 1 : P.value.length),
|
|
858
|
+
y: e.coordinatesLine[l].y
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
x: o.value.left + o.value.slot * l + o.value.slot / 10 + (d.value.stacked ? 0 : o.value.slot / P.value.length * t - (t === 0 ? 0 : o.value.slot / (5 * P.value.length) * t)),
|
|
862
|
+
y: e.coordinatesLine[l].y
|
|
863
|
+
}
|
|
864
|
+
],
|
|
865
|
+
{
|
|
866
|
+
strokeColor: a.value.style.chart.backgroundColor,
|
|
867
|
+
gradient: {
|
|
868
|
+
type: "linear",
|
|
869
|
+
start: {
|
|
870
|
+
x: e.coordinatesLine[l].x,
|
|
871
|
+
y: e.coordinatesLine[l].y
|
|
872
|
+
},
|
|
873
|
+
end: {
|
|
874
|
+
x: e.coordinatesLine[l].x,
|
|
875
|
+
y: d.value.stacked ? e.localZero : A.value.zero
|
|
876
|
+
},
|
|
877
|
+
stops: [
|
|
878
|
+
{ offset: 0, color: e.color },
|
|
879
|
+
{ offset: 1, color: a.value.style.chart.bar.gradient.show ? Sl(e.color, 0.5) : e.color }
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
), d.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && Q(
|
|
884
|
+
v.value,
|
|
885
|
+
ce(
|
|
886
|
+
a.value.style.chart.dataLabels.formatter,
|
|
887
|
+
e.coordinatesLine[l].value,
|
|
888
|
+
de({
|
|
889
|
+
p: e.prefix || "",
|
|
890
|
+
v: e.coordinatesLine[l].value,
|
|
891
|
+
s: e.suffix || "",
|
|
892
|
+
r: e.rounding || 0
|
|
893
|
+
}),
|
|
894
|
+
{ datapoint: e.coordinatesLine[l], seriesIndex: l }
|
|
895
|
+
),
|
|
896
|
+
o.value.left + o.value.slot * l + o.value.slot / 10 + (d.value.stacked ? 0 : o.value.slot / P.value.length * t - (t === 0 ? 0 : o.value.slot / (5 * P.value.length) * t)) + o.value.slot * 0.4 / (d.value.stacked ? 1 : P.value.length),
|
|
897
|
+
(e.coordinatesLine[l].value < 0 ? d.value.stacked ? e.localZero : A.value.zero : e.coordinatesLine[l].y) + a.value.style.chart.dataLabels.offsetY,
|
|
898
|
+
{
|
|
899
|
+
align: "center",
|
|
900
|
+
font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
901
|
+
color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
|
|
902
|
+
strokeColor: a.value.style.chart.backgroundColor,
|
|
903
|
+
lineWidth: 0.8
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function Vt(e, t) {
|
|
909
|
+
const l = e.coordinatesLine.map((r, m) => {
|
|
910
|
+
const L = e.series[m];
|
|
911
|
+
return L != null && Number.isFinite(r?.y) ? r : null;
|
|
912
|
+
}), u = [], n = [];
|
|
913
|
+
let i = [];
|
|
914
|
+
for (let r = 0; r < l.length; r += 1) {
|
|
915
|
+
const m = l[r];
|
|
916
|
+
if (m)
|
|
917
|
+
i.push(m);
|
|
918
|
+
else {
|
|
919
|
+
if (i.length >= 2) {
|
|
920
|
+
const L = i[0], x = i[i.length - 1];
|
|
921
|
+
u.push([
|
|
922
|
+
{ x: L.x, y: t },
|
|
923
|
+
...i,
|
|
924
|
+
{ x: x.x, y: t }
|
|
925
|
+
]);
|
|
926
|
+
} else i.length === 1 && n.push(i[0]);
|
|
927
|
+
i = [];
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
if (i.length >= 2) {
|
|
931
|
+
const r = i[0], m = i[i.length - 1];
|
|
932
|
+
u.push([
|
|
933
|
+
{ x: r.x, y: t },
|
|
934
|
+
...i,
|
|
935
|
+
{ x: m.x, y: t }
|
|
936
|
+
]);
|
|
937
|
+
} else i.length === 1 && n.push(i[0]);
|
|
938
|
+
return { polygons: u, singles: n };
|
|
939
|
+
}
|
|
940
|
+
function Ut(e) {
|
|
941
|
+
const t = e.coordinatesLine.map((n, i) => {
|
|
942
|
+
const r = e.series[i];
|
|
943
|
+
return r != null && Number.isFinite(n?.y) ? n : null;
|
|
944
|
+
}), l = [];
|
|
945
|
+
let u = [];
|
|
946
|
+
for (let n = 0; n < t.length; n += 1) {
|
|
947
|
+
const i = t[n];
|
|
948
|
+
i ? u.push(i) : (u.length >= 2 && l.push(u), u = []);
|
|
949
|
+
}
|
|
950
|
+
return u.length >= 2 && l.push(u), l;
|
|
951
|
+
}
|
|
952
|
+
function Ha(e) {
|
|
953
|
+
if (Ee.value) {
|
|
954
|
+
const t = Ut(e);
|
|
955
|
+
for (const l of t)
|
|
956
|
+
T(v.value, l, {
|
|
957
|
+
color: e.color,
|
|
958
|
+
lineWidth: 3
|
|
959
|
+
});
|
|
960
|
+
} else
|
|
961
|
+
T(v.value, e.coordinatesLine, {
|
|
962
|
+
color: e.color,
|
|
963
|
+
lineWidth: 3
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
function Yt(e) {
|
|
967
|
+
const t = !!Ee.value;
|
|
968
|
+
if (e.useArea) {
|
|
969
|
+
const l = d.value.stacked ? e.localZero : A.value.zero;
|
|
970
|
+
if (t) {
|
|
971
|
+
const { polygons: u, singles: n } = Vt(e, l);
|
|
972
|
+
for (const r of u)
|
|
973
|
+
st(v.value, r, {
|
|
974
|
+
fillColor: Ie(e.color, a.value.style.chart.area.opacity),
|
|
975
|
+
strokeColor: "transparent"
|
|
976
|
+
});
|
|
977
|
+
const i = y.value / 200 * a.value.style.chart.line.plots.radiusRatio;
|
|
978
|
+
for (const r of n)
|
|
979
|
+
va(
|
|
980
|
+
v.value,
|
|
981
|
+
{ x: r.x, y: r.y },
|
|
982
|
+
i,
|
|
983
|
+
{
|
|
984
|
+
color: a.value.style.chart.backgroundColor,
|
|
985
|
+
fillStyle: e.color
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
} else {
|
|
989
|
+
const u = { x: e.coordinatesLine[0].x, y: l }, n = { x: e.coordinatesLine.at(-1).x, y: l };
|
|
990
|
+
st(
|
|
991
|
+
v.value,
|
|
992
|
+
[u, ...e.coordinatesLine, n],
|
|
993
|
+
{
|
|
994
|
+
fillColor: Ie(e.color, a.value.style.chart.area.opacity),
|
|
995
|
+
strokeColor: "transparent"
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
Ha(e);
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
Ha(e);
|
|
1003
|
+
}
|
|
1004
|
+
function qt() {
|
|
1005
|
+
f.value.forEach((e, t) => {
|
|
1006
|
+
T(
|
|
1007
|
+
v.value,
|
|
1008
|
+
[
|
|
1009
|
+
{ x: o.value.left, y: o.value.bottom - e.yOffset },
|
|
1010
|
+
{ x: o.value.right, y: o.value.bottom - e.yOffset }
|
|
1011
|
+
],
|
|
1012
|
+
{
|
|
1013
|
+
color: a.value.style.chart.grid.x.horizontalLines.color,
|
|
1014
|
+
lineWidth: 1
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
function jt() {
|
|
1020
|
+
const { left: e, top: t, width: l, height: u } = o.value, n = s.value.start, r = s.value.end - n, m = l / r, L = F.value.start - n, x = F.value.end - n, S = Math.max(0, Math.min(r, L)), R = Math.max(0, Math.min(r, x));
|
|
1021
|
+
Ve(
|
|
1022
|
+
v.value,
|
|
1023
|
+
[
|
|
1024
|
+
{ x: e + S * m, y: t },
|
|
1025
|
+
{ x: e + S * m + (R - S) * m, y: t },
|
|
1026
|
+
{ x: e + S * m + (R - S) * m, y: t + u },
|
|
1027
|
+
{ x: e + S * m, y: t + u }
|
|
1028
|
+
],
|
|
1029
|
+
{
|
|
1030
|
+
fillColor: a.value.style.chart.zoom.preview.fill,
|
|
1031
|
+
strokeColor: a.value.style.chart.zoom.preview.stroke,
|
|
1032
|
+
lineDash: Array(4).fill(a.value.style.chart.zoom.preview.strokeDasharray),
|
|
1033
|
+
lineWidth: a.value.style.chart.zoom.preview.strokeWidth
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1037
|
+
function J() {
|
|
1038
|
+
!U.value || !k.value || !v.value || (Ot(), N.value ? ((h.value !== null || $.value !== null) && a.value.style.chart.selector.show && Ba(), _t(), d.value.stacked && a.value.style.chart.grid.x.showAxis && qt(), Dt.value.forEach((e) => {
|
|
1039
|
+
(e.type === "line" || !e.type) && Yt(e), X.value && (Et(e), d.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && Ht(e));
|
|
1040
|
+
}), k.value && (Fe.value = $l(k.value))) : (Fe.value && (v.value.clearRect(0, 0, 1e4, 1e4), v.value.drawImage(Fe.value, 0, 0)), (h.value !== null || $.value !== null) && a.value.style.chart.selector.show && Ba(), (h.value !== null || $.value !== null) && f.value.forEach((e) => {
|
|
1041
|
+
const t = h.value ?? $.value, l = e.coordinatesLine[t];
|
|
1042
|
+
(e.type === "line" || !e.type || e.type === "plot") && l && Number.isFinite(l.x) && Number.isFinite(l.y) && va(
|
|
1043
|
+
v.value,
|
|
1044
|
+
{ x: l.x, y: l.y },
|
|
1045
|
+
y.value / 150 * a.value.style.chart.line.plots.radiusRatio,
|
|
1046
|
+
{
|
|
1047
|
+
color: a.value.style.chart.backgroundColor,
|
|
1048
|
+
fillStyle: e.color
|
|
1049
|
+
}
|
|
1050
|
+
);
|
|
1051
|
+
})), a.value.style.chart.grid.x.timeLabels.show && Wt(), a.value.style.chart.selector.show && a.value.style.chart.selector.showHorizontalSelector && Xt(), Bt(), Nt(), a.value.style.chart.zoom.preview.enable && (s.value.start !== F.value.start || s.value.end !== F.value.end) && jt(), N.value = !1);
|
|
1052
|
+
}
|
|
1053
|
+
const Le = Al(() => {
|
|
1054
|
+
X.value = !0, Ne();
|
|
1055
|
+
}, O.value > 200 ? 10 : 1, !X.value);
|
|
1056
|
+
function Ce(e) {
|
|
1057
|
+
if ([null, void 0].includes(h.value ?? $.value) || !e.coordinatesLine[h.value ?? $.value]) return !1;
|
|
1058
|
+
const { y: t, value: l } = e.coordinatesLine[h.value ?? $.value];
|
|
1059
|
+
return { y: t, value: l };
|
|
1060
|
+
}
|
|
1061
|
+
function Gt(e) {
|
|
1062
|
+
if (!U.value || !k.value || aa.value) return;
|
|
1063
|
+
const { left: t, top: l } = k.value.getBoundingClientRect(), u = e.clientX - t;
|
|
1064
|
+
if (_.value = (e.clientY - l) * 2, (_.value < o.value.top || _.value > o.value.bottom) && (_.value = null), u * 2 < o.value.left || u * 2 > o.value.right) {
|
|
1065
|
+
ke();
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const n = u * 2 - o.value.left, i = Math.floor(n / o.value.slot);
|
|
1069
|
+
if (h.value = i, V.value = i, he.value = !0, Re.value = !1, !X.value) return;
|
|
1070
|
+
let r = "";
|
|
1071
|
+
const m = a.value.style.chart.tooltip.customFormat, L = f.value.map((x) => ({
|
|
1072
|
+
shape: x.shape || null,
|
|
1073
|
+
name: x.name,
|
|
1074
|
+
color: x.color,
|
|
1075
|
+
type: x.type || "line",
|
|
1076
|
+
value: x.series.find((S, R) => R === h.value)
|
|
1077
|
+
}));
|
|
1078
|
+
Me.value = {
|
|
1079
|
+
timeLabel: a.value.style.chart.grid.x.timeLabels.values.slice(s.value.start, s.value.end)[h.value] ? a.value.style.chart.tooltip.useDefaultTimeFormat ? w.value.slice(s.value.start, s.value.end)[h.value]?.text : Be.value[h.value]?.text : "",
|
|
1080
|
+
datapoint: L,
|
|
1081
|
+
seriesIndex: h.value,
|
|
1082
|
+
series: f.value,
|
|
1083
|
+
config: a.value
|
|
1084
|
+
}, Xa({ seriesIndex: h.value, datapoint: L }), ia(m) && ot(() => m({
|
|
1085
|
+
seriesIndex: h.value,
|
|
1086
|
+
datapoint: L,
|
|
1087
|
+
series: f.value,
|
|
1088
|
+
config: a.value
|
|
1089
|
+
})) ? fe.value = m({
|
|
1090
|
+
seriesIndex: h.value,
|
|
1091
|
+
datapoint: L,
|
|
1092
|
+
series: f.value,
|
|
1093
|
+
config: a.value
|
|
1094
|
+
}) : (a.value.style.chart.grid.x.timeLabels.values.slice(s.value.start, s.value.end)[h.value] ? r += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.tooltip.useDefaultTimeFormat ? w.value.slice(s.value.start, s.value.end)[h.value]?.text : Be.value[h.value]?.text}</div>` : r += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${w.value[h.value + s.value.start]?.text ?? ""}</div>`, r += Ia.value.join(""), fe.value = r), X.value = !1;
|
|
1095
|
+
}
|
|
1096
|
+
function Zt(e) {
|
|
1097
|
+
return f.value.map((t) => ({
|
|
1098
|
+
shape: t.shape || null,
|
|
1099
|
+
name: t.name,
|
|
1100
|
+
color: t.color,
|
|
1101
|
+
type: t.type || "line",
|
|
1102
|
+
value: t.series.find((l, u) => u === e)
|
|
1103
|
+
}));
|
|
1104
|
+
}
|
|
1105
|
+
function Kt(e) {
|
|
1106
|
+
let t = "";
|
|
1107
|
+
const l = a.value.style.chart.tooltip.customFormat, u = Zt(e);
|
|
1108
|
+
return Xa({ seriesIndex: e, datapoint: u }), ia(l) && ot(() => l({
|
|
1109
|
+
seriesIndex: e,
|
|
1110
|
+
datapoint: u,
|
|
1111
|
+
series: f.value,
|
|
1112
|
+
config: a.value
|
|
1113
|
+
})) ? l({
|
|
1114
|
+
seriesIndex: e,
|
|
1115
|
+
datapoint: u,
|
|
1116
|
+
series: f.value,
|
|
1117
|
+
config: a.value
|
|
1118
|
+
}) : (a.value.style.chart.grid.x.timeLabels.values.slice(s.value.start, s.value.end)[e] ? t += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.tooltip.useDefaultTimeFormat ? w.value.slice(s.value.start, s.value.end)[e]?.text : Be.value[e]?.text}</div>` : t += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${w.value[e + s.value.start]?.text ?? ""}</div>`, t += Ia.value.join(""), t);
|
|
1119
|
+
}
|
|
1120
|
+
function Jt(e) {
|
|
1121
|
+
if (!k.value || !o.value?.slot) return;
|
|
1122
|
+
const t = k.value.getBoundingClientRect(), l = t.width / o.value.canvasWidth, u = t.height / o.value.canvasHeight, n = o.value.left + o.value.slot * e + o.value.slot / 2, i = o.value.top + o.value.height / 2;
|
|
1123
|
+
pa.value = {
|
|
1124
|
+
x: t.left + n * l,
|
|
1125
|
+
y: t.top + i * u
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function Wa(e, { fromKeyboard: t = !1 } = {}) {
|
|
1129
|
+
!U.value || aa.value || e != null && (e < 0 || e >= s.value.end - s.value.start || (h.value = e, V.value = e, he.value = !0, Re.value = t, fe.value = Kt(e), t && Jt(e), X.value = !1, J()));
|
|
1130
|
+
}
|
|
1131
|
+
function ke() {
|
|
1132
|
+
he.value = !1, h.value = null, V.value = null, fe.value = "", _.value = null, Re.value = !1, J();
|
|
1133
|
+
}
|
|
1134
|
+
function Qt() {
|
|
1135
|
+
Ke.value = !0;
|
|
1136
|
+
}
|
|
1137
|
+
function el() {
|
|
1138
|
+
Ke.value = !1, ke();
|
|
1139
|
+
}
|
|
1140
|
+
function al(e) {
|
|
1141
|
+
if (!k.value || we.value || document.activeElement !== k.value) return;
|
|
1142
|
+
const t = e.key === "ArrowLeft", l = e.key === "ArrowRight";
|
|
1143
|
+
if (!t && !l) return;
|
|
1144
|
+
const u = s.value.end - s.value.start;
|
|
1145
|
+
if (u <= 0) return;
|
|
1146
|
+
e.preventDefault(), e.stopPropagation();
|
|
1147
|
+
let n = V.value;
|
|
1148
|
+
n !== null && n >= 0 && n < u ? l ? (n += 1, n >= u && (n = 0)) : (n -= 1, n < 0 && (n = u - 1)) : l ? n = 0 : n = u - 1, Wa(n, { fromKeyboard: !0 });
|
|
1149
|
+
}
|
|
1150
|
+
function Xa({ seriesIndex: e, datapoint: t }) {
|
|
1151
|
+
const l = s.value.start + e;
|
|
1152
|
+
De("selectX", {
|
|
1153
|
+
dataset: t,
|
|
1154
|
+
index: l,
|
|
1155
|
+
indexLabel: ""
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
E(() => D.selectedXIndex, (e) => {
|
|
1159
|
+
if ([null, void 0].includes(D.selectedXIndex)) {
|
|
1160
|
+
ke();
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
const t = e - s.value.start;
|
|
1164
|
+
t < 0 || e >= s.value.end ? ke() : Wa(t, { fromKeyboard: !1 });
|
|
1165
|
+
}, { immediate: !0 }), E(() => h.value, (e) => {
|
|
1166
|
+
Le();
|
|
1167
|
+
}), E(() => s.value, (e) => {
|
|
1168
|
+
N.value = !0, J();
|
|
1169
|
+
}, {
|
|
1170
|
+
deep: !0
|
|
1171
|
+
}), E(() => F.value, (e) => {
|
|
1172
|
+
J();
|
|
1173
|
+
}, { deep: !0 }), E(() => d.value.showDataLabels, (e) => {
|
|
1174
|
+
N.value = !0, J();
|
|
1175
|
+
}), E(() => _.value, (e) => {
|
|
1176
|
+
e && J();
|
|
1177
|
+
}), E(() => d.value.stacked, (e) => {
|
|
1178
|
+
N.value = !0, X.value = !0, Le();
|
|
1179
|
+
});
|
|
1180
|
+
function tl() {
|
|
1181
|
+
ke();
|
|
1182
|
+
}
|
|
1183
|
+
const te = na(null), re = na(null), ie = na(null);
|
|
1184
|
+
Ja(() => {
|
|
1185
|
+
ya.value = !0, _a();
|
|
1186
|
+
});
|
|
1187
|
+
function _a() {
|
|
1188
|
+
if (kl(D.dataset) && xt.value && wl({ componentName: "VueUiXyCanvas", type: "dataset" }), Te(() => {
|
|
1189
|
+
k.value && !v.value && (v.value = k.value.getContext("2d", { willReadFrequently: !0 })), v.value && U.value && (N.value = !0, X.value = !0, Ne());
|
|
1190
|
+
}), a.value.responsive) {
|
|
1191
|
+
const e = Il(() => {
|
|
1192
|
+
const { width: t, height: l } = Ml({
|
|
1193
|
+
chart: K.value,
|
|
1194
|
+
title: a.value.style.chart.title.text ? ha.value : null,
|
|
1195
|
+
legend: a.value.style.chart.legend.show ? fa.value : null,
|
|
1196
|
+
slicer: a.value.style.chart.zoom.show && O.value > 6 ? ae.value?.$el : null,
|
|
1197
|
+
source: ma.value
|
|
1198
|
+
});
|
|
1199
|
+
requestAnimationFrame(() => {
|
|
1200
|
+
La.value = `${t} / ${l}`;
|
|
1201
|
+
});
|
|
1202
|
+
});
|
|
1203
|
+
te.value && (re.value && te.value.unobserve(re.value), te.value.disconnect()), te.value = new ResizeObserver(e), re.value = K.value.parentNode, te.value.observe(re.value);
|
|
1204
|
+
}
|
|
1205
|
+
ie.value && ie.value.disconnect(), ie.value = new ResizeObserver(async (e) => {
|
|
1206
|
+
for (const t of e)
|
|
1207
|
+
t.contentBoxSize && ue.value && (N.value = !0, Le());
|
|
1208
|
+
}), ie.value.observe(ue.value), xe();
|
|
1209
|
+
}
|
|
1210
|
+
sa(() => {
|
|
1211
|
+
ie.value && ie.value.disconnect(), te.value && (re.value && te.value.unobserve(re.value), te.value.disconnect());
|
|
1212
|
+
});
|
|
1213
|
+
function ll() {
|
|
1214
|
+
p.value.length ? p.value = [] : We.value.forEach((e, t) => {
|
|
1215
|
+
p.value.push(t);
|
|
1216
|
+
}), N.value = !0, Le();
|
|
1217
|
+
}
|
|
1218
|
+
function He(e) {
|
|
1219
|
+
De("selectLegend", f.value.find((t) => t.absoluteIndex === e)), p.value.includes(e) ? p.value = p.value.filter((t) => t !== e) : p.value.push(e), N.value = !0, Le();
|
|
1220
|
+
}
|
|
1221
|
+
function Va(e) {
|
|
1222
|
+
if (!M.value.length)
|
|
1223
|
+
return a.value.debug && console.warn("VueUiXyCanvas - There are no series to show."), null;
|
|
1224
|
+
const t = M.value.find((l) => l.name === e);
|
|
1225
|
+
return t || (a.value.debug && console.warn(`VueUiXyCanvas - Series name not found "${e}"`), null);
|
|
1226
|
+
}
|
|
1227
|
+
function ol(e) {
|
|
1228
|
+
const t = Va(e);
|
|
1229
|
+
t !== null && p.value.includes(t.absoluteIndex) && He(t.absoluteIndex);
|
|
1230
|
+
}
|
|
1231
|
+
function sl(e) {
|
|
1232
|
+
const t = Va(e);
|
|
1233
|
+
t !== null && (p.value.includes(t.absoluteIndex) || He(t.absoluteIndex));
|
|
1234
|
+
}
|
|
1235
|
+
const We = g(() => M.value.map((e, t) => ({
|
|
1236
|
+
...e,
|
|
1237
|
+
name: e.name,
|
|
1238
|
+
color: lt(e.color) || Ta.value[t] || se[t] || se[t % se.length],
|
|
1239
|
+
shape: e.shape || "circle",
|
|
1240
|
+
prefix: e.prefix || "",
|
|
1241
|
+
suffix: e.suffix || "",
|
|
1242
|
+
rounding: e.rounding || 0
|
|
1243
|
+
})).map((e) => ({
|
|
1244
|
+
...e,
|
|
1245
|
+
opacity: p.value.includes(e.absoluteIndex) ? 0.5 : 1,
|
|
1246
|
+
segregate: () => He(e.absoluteIndex),
|
|
1247
|
+
isSegregated: p.value.includes(e.absoluteIndex)
|
|
1248
|
+
}))), ul = g(() => ({
|
|
1249
|
+
cy: "donut-div-legend",
|
|
1250
|
+
backgroundColor: a.value.style.chart.legend.backgroundColor,
|
|
1251
|
+
color: a.value.style.chart.legend.color,
|
|
1252
|
+
fontSize: a.value.style.chart.legend.fontSize,
|
|
1253
|
+
paddingBottom: 12,
|
|
1254
|
+
fontWeight: a.value.style.chart.legend.bold ? "bold" : ""
|
|
1255
|
+
})), Xe = g(() => {
|
|
1256
|
+
const e = [""].concat(f.value.map((n) => n.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');
|
|
1257
|
+
let t = [];
|
|
1258
|
+
for (let n = 0; n < O.value; n += 1) {
|
|
1259
|
+
const i = f.value.map((r) => r.series[n] ?? 0).reduce((r, m) => r + m, 0);
|
|
1260
|
+
t.push(
|
|
1261
|
+
[
|
|
1262
|
+
a.value.style.chart.grid.x.timeLabels.values.slice(s.value.start, s.value.end)[n] ? w?.value?.slice(s.value.start, s.value.end)?.[n]?.text ?? n + 1 : n + 1
|
|
1263
|
+
].concat(
|
|
1264
|
+
f.value.map(
|
|
1265
|
+
(r) => (r.series[n] ?? 0).toFixed(a.value.table.rounding)
|
|
1266
|
+
)
|
|
1267
|
+
).concat((i ?? 0).toFixed(a.value.table.rounding))
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
const l = {
|
|
1271
|
+
th: {
|
|
1272
|
+
backgroundColor: a.value.table.th.backgroundColor,
|
|
1273
|
+
color: a.value.table.th.color,
|
|
1274
|
+
outline: a.value.table.th.outline
|
|
1275
|
+
},
|
|
1276
|
+
td: {
|
|
1277
|
+
backgroundColor: a.value.table.td.backgroundColor,
|
|
1278
|
+
color: a.value.table.td.color,
|
|
1279
|
+
outline: a.value.table.td.outline
|
|
1280
|
+
},
|
|
1281
|
+
breakpoint: a.value.table.responsiveBreakpoint
|
|
1282
|
+
}, u = [a.value.table.columnNames.period].concat(f.value.map((n) => n.name)).concat(a.value.table.columnNames.total);
|
|
1283
|
+
return { head: e, body: t.slice(0, s.value.end - s.value.start), config: l, colNames: u };
|
|
1284
|
+
}), Ua = g(() => {
|
|
1285
|
+
if (f.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
|
|
1286
|
+
const e = f.value.map((l) => ({
|
|
1287
|
+
label: l.name,
|
|
1288
|
+
color: l.color,
|
|
1289
|
+
type: l.type
|
|
1290
|
+
})), t = [];
|
|
1291
|
+
for (let l = s.value.start; l < s.value.end; l += 1) {
|
|
1292
|
+
const u = [a.value.style.chart.grid.x.timeLabels.values[l] ? w.value[l].text : l + 1];
|
|
1293
|
+
f.value.forEach((n) => {
|
|
1294
|
+
u.push(Number((n.series[l] || 0).toFixed(a.value.table.rounding)));
|
|
1295
|
+
}), t.push(u);
|
|
1296
|
+
}
|
|
1297
|
+
return { head: e, body: t };
|
|
1298
|
+
});
|
|
1299
|
+
function la(e = null) {
|
|
1300
|
+
const t = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], l = ["", ...Ua.value.head.map((r) => r.label)], u = Ua.value.body, n = t.concat([l]).concat(u), i = zl(n);
|
|
1301
|
+
e ? e(i) : Tl({ csvContent: i, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
|
|
1302
|
+
}
|
|
1303
|
+
function nl() {
|
|
1304
|
+
return f.value;
|
|
1305
|
+
}
|
|
1306
|
+
function Ya() {
|
|
1307
|
+
d.value.showTable = !d.value.showTable;
|
|
1308
|
+
}
|
|
1309
|
+
function qa() {
|
|
1310
|
+
d.value.showDataLabels = !d.value.showDataLabels;
|
|
1311
|
+
}
|
|
1312
|
+
function ja() {
|
|
1313
|
+
d.value.stacked = !d.value.stacked;
|
|
1314
|
+
}
|
|
1315
|
+
function Ga() {
|
|
1316
|
+
d.value.showTooltip = !d.value.showTooltip;
|
|
1317
|
+
}
|
|
1318
|
+
const we = c(!1);
|
|
1319
|
+
function oa() {
|
|
1320
|
+
we.value = !we.value;
|
|
1321
|
+
}
|
|
1322
|
+
async function rl({ scale: e = 2 } = {}) {
|
|
1323
|
+
if (!K.value) return;
|
|
1324
|
+
const { width: t, height: l } = K.value.getBoundingClientRect(), u = t / l, { imageUri: n, base64: i } = await Wl({ domElement: K.value, base64: !0, img: !0, scale: e });
|
|
1325
|
+
return {
|
|
1326
|
+
imageUri: n,
|
|
1327
|
+
base64: i,
|
|
1328
|
+
title: a.value.style.chart.title.text,
|
|
1329
|
+
width: t,
|
|
1330
|
+
height: l,
|
|
1331
|
+
aspectRatio: u
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
const Se = g(() => {
|
|
1335
|
+
const e = a.value.table.useDialog && !a.value.table.show, t = d.value.showTable;
|
|
1336
|
+
return {
|
|
1337
|
+
component: e ? ht : Yl,
|
|
1338
|
+
title: `${a.value.style.chart.title.text}${a.value.style.chart.title.subtitle.text ? `: ${a.value.style.chart.title.subtitle.text}` : ""}`,
|
|
1339
|
+
props: e ? {
|
|
1340
|
+
backgroundColor: a.value.table.th.backgroundColor,
|
|
1341
|
+
color: a.value.table.th.color,
|
|
1342
|
+
headerColor: a.value.table.th.color,
|
|
1343
|
+
headerBg: a.value.table.th.backgroundColor,
|
|
1344
|
+
isFullscreen: me.value,
|
|
1345
|
+
fullscreenParent: K.value,
|
|
1346
|
+
forcedWidth: Math.min(800, window.innerWidth * 0.8),
|
|
1347
|
+
isCursorPointer: le.value
|
|
1348
|
+
} : {
|
|
1349
|
+
hideDetails: !0,
|
|
1350
|
+
config: {
|
|
1351
|
+
open: t,
|
|
1352
|
+
maxHeight: 1e4,
|
|
1353
|
+
body: {
|
|
1354
|
+
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1355
|
+
color: a.value.style.chart.color
|
|
1356
|
+
},
|
|
1357
|
+
head: {
|
|
1358
|
+
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1359
|
+
color: a.value.style.chart.color
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
});
|
|
1365
|
+
E(() => d.value.showTable, (e) => {
|
|
1366
|
+
a.value.table.show || (e && a.value.table.useDialog && ye.value ? ye.value.open() : "close" in ye.value && ye.value.close());
|
|
1367
|
+
});
|
|
1368
|
+
function Za() {
|
|
1369
|
+
d.value.showTable = !1, Ge.value && Ge.value.setTableIconState(!1);
|
|
1370
|
+
}
|
|
1371
|
+
function il(e) {
|
|
1372
|
+
if (e?.stage === "start") {
|
|
1373
|
+
Ze.value = !0;
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
if (e?.stage === "end") {
|
|
1377
|
+
Ze.value = !1;
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
Sa();
|
|
1381
|
+
}
|
|
1382
|
+
async function Ka() {
|
|
1383
|
+
if (De("copyAlt", {
|
|
1384
|
+
config: a.value,
|
|
1385
|
+
dataset: f.value
|
|
1386
|
+
}), !a.value.userOptions.callbacks.altCopy) {
|
|
1387
|
+
console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
await Promise.resolve(a.value.userOptions.callbacks.altCopy({
|
|
1391
|
+
config: a.value,
|
|
1392
|
+
dataset: f.value
|
|
1393
|
+
}));
|
|
1394
|
+
}
|
|
1395
|
+
return nt({
|
|
1396
|
+
getData: nl,
|
|
1397
|
+
getImage: rl,
|
|
1398
|
+
generateCsv: la,
|
|
1399
|
+
generatePdf: wa,
|
|
1400
|
+
generateImage: Sa,
|
|
1401
|
+
hideSeries: sl,
|
|
1402
|
+
showSeries: ol,
|
|
1403
|
+
toggleTable: Ya,
|
|
1404
|
+
toggleLabels: qa,
|
|
1405
|
+
toggleStack: ja,
|
|
1406
|
+
toggleTooltip: Ga,
|
|
1407
|
+
toggleAnnotator: oa,
|
|
1408
|
+
toggleFullscreen: za,
|
|
1409
|
+
copyAlt: Ka
|
|
1410
|
+
}), (e, t) => (I(), $e("div", {
|
|
1411
|
+
style: ve(`width:100%; position:relative; ${a.value.responsive ? "height: 100%" : ""}; background:${a.value.style.chart.backgroundColor};`),
|
|
1412
|
+
ref_key: "xy",
|
|
1413
|
+
ref: K,
|
|
1414
|
+
id: `xy_canvas_${Z.value}`,
|
|
1415
|
+
class: dl(`vue-data-ui-component vue-ui-xy-canvas ${me.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
|
|
1416
|
+
onMouseenter: Ct,
|
|
1417
|
+
onMouseleave: kt
|
|
1418
|
+
}, [
|
|
1419
|
+
H("div", {
|
|
1420
|
+
id: `chart-instructions-${Z.value}`,
|
|
1421
|
+
class: "sr-only"
|
|
1422
|
+
}, [
|
|
1423
|
+
H("p", null, Ae(a.value.a11y.translations.keyboardNavigation), 1)
|
|
1424
|
+
], 8, Kl),
|
|
1425
|
+
H("div", Jl, Ae(bt.value), 1),
|
|
1426
|
+
a.value.style.chart.title.text ? (I(), $e("div", {
|
|
1427
|
+
key: 0,
|
|
1428
|
+
ref_key: "chartTitle",
|
|
1429
|
+
ref: ha,
|
|
1430
|
+
style: ve(`width:100%;background:${a.value.style.chart.backgroundColor};`)
|
|
1431
|
+
}, [
|
|
1432
|
+
(I(), q(Vl, {
|
|
1433
|
+
key: `title_${Ye.value}`,
|
|
1434
|
+
config: {
|
|
1435
|
+
title: {
|
|
1436
|
+
cy: "xy-canvas-title",
|
|
1437
|
+
...a.value.style.chart.title
|
|
1438
|
+
},
|
|
1439
|
+
subtitle: {
|
|
1440
|
+
cy: "xy-canvas-subtitle",
|
|
1441
|
+
...a.value.style.chart.title.subtitle
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
}, null, 8, ["config"]))
|
|
1445
|
+
], 4)) : W("", !0),
|
|
1446
|
+
H("div", {
|
|
1447
|
+
id: `legend-top-${Z.value}`
|
|
1448
|
+
}, null, 8, Ql),
|
|
1449
|
+
a.value.userOptions.show && U.value && (z(xa) || z(Qe)) ? (I(), q(z(ct), {
|
|
1450
|
+
ref_key: "userOptionsRef",
|
|
1451
|
+
ref: Ge,
|
|
1452
|
+
key: `user_option_${da.value}`,
|
|
1453
|
+
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1454
|
+
color: a.value.style.chart.color,
|
|
1455
|
+
isPrinting: z(Ca),
|
|
1456
|
+
isImaging: z(ka),
|
|
1457
|
+
uid: Z.value,
|
|
1458
|
+
hasTooltip: a.value.userOptions.buttons.tooltip && a.value.style.chart.tooltip.show,
|
|
1459
|
+
hasPdf: a.value.userOptions.buttons.pdf,
|
|
1460
|
+
hasImg: a.value.userOptions.buttons.img,
|
|
1461
|
+
hasXls: a.value.userOptions.buttons.csv,
|
|
1462
|
+
hasLabel: a.value.userOptions.buttons.labels,
|
|
1463
|
+
hasStack: ca.dataset.length > 1 && a.value.userOptions.buttons.stack,
|
|
1464
|
+
hasFullscreen: a.value.userOptions.buttons.fullscreen,
|
|
1465
|
+
hasAltCopy: a.value.userOptions.buttons.altCopy,
|
|
1466
|
+
hasTable: s.value.end - s.value.start <= 730 && a.value.userOptions.buttons.table,
|
|
1467
|
+
isFullscreen: me.value,
|
|
1468
|
+
isTooltip: d.value.showTooltip,
|
|
1469
|
+
isStacked: d.value.stacked,
|
|
1470
|
+
titles: { ...a.value.userOptions.buttonTitles },
|
|
1471
|
+
chartElement: K.value,
|
|
1472
|
+
position: a.value.userOptions.position,
|
|
1473
|
+
hasAnnotator: a.value.userOptions.buttons.annotator,
|
|
1474
|
+
isAnnotation: we.value,
|
|
1475
|
+
callbacks: a.value.userOptions.callbacks,
|
|
1476
|
+
printScale: a.value.userOptions.print.scale,
|
|
1477
|
+
tableDialog: a.value.table.useDialog,
|
|
1478
|
+
isCursorPointer: le.value,
|
|
1479
|
+
onToggleFullscreen: za,
|
|
1480
|
+
onGeneratePdf: z(wa),
|
|
1481
|
+
onGenerateCsv: la,
|
|
1482
|
+
onGenerateImage: il,
|
|
1483
|
+
onToggleTable: Ya,
|
|
1484
|
+
onToggleLabels: qa,
|
|
1485
|
+
onToggleStack: ja,
|
|
1486
|
+
onToggleTooltip: Ga,
|
|
1487
|
+
onToggleAnnotator: oa,
|
|
1488
|
+
onCopyAlt: Ka,
|
|
1489
|
+
style: ve({
|
|
1490
|
+
visibility: z(xa) ? z(Qe) ? "visible" : "hidden" : "visible"
|
|
1491
|
+
})
|
|
1492
|
+
}, Qa({ _: 2 }, [
|
|
1493
|
+
e.$slots.menuIcon ? {
|
|
1494
|
+
name: "menuIcon",
|
|
1495
|
+
fn: b(({ isOpen: l, color: u }) => [
|
|
1496
|
+
C(e.$slots, "menuIcon", j(G({ isOpen: l, color: u })), void 0, !0)
|
|
1497
|
+
]),
|
|
1498
|
+
key: "0"
|
|
1499
|
+
} : void 0,
|
|
1500
|
+
e.$slots.optionTooltip ? {
|
|
1501
|
+
name: "optionTooltip",
|
|
1502
|
+
fn: b(() => [
|
|
1503
|
+
C(e.$slots, "optionTooltip", {}, void 0, !0)
|
|
1504
|
+
]),
|
|
1505
|
+
key: "1"
|
|
1506
|
+
} : void 0,
|
|
1507
|
+
e.$slots.optionPdf ? {
|
|
1508
|
+
name: "optionPdf",
|
|
1509
|
+
fn: b(() => [
|
|
1510
|
+
C(e.$slots, "optionPdf", {}, void 0, !0)
|
|
1511
|
+
]),
|
|
1512
|
+
key: "2"
|
|
1513
|
+
} : void 0,
|
|
1514
|
+
e.$slots.optionCsv ? {
|
|
1515
|
+
name: "optionCsv",
|
|
1516
|
+
fn: b(() => [
|
|
1517
|
+
C(e.$slots, "optionCsv", {}, void 0, !0)
|
|
1518
|
+
]),
|
|
1519
|
+
key: "3"
|
|
1520
|
+
} : void 0,
|
|
1521
|
+
e.$slots.optionImg ? {
|
|
1522
|
+
name: "optionImg",
|
|
1523
|
+
fn: b(() => [
|
|
1524
|
+
C(e.$slots, "optionImg", {}, void 0, !0)
|
|
1525
|
+
]),
|
|
1526
|
+
key: "4"
|
|
1527
|
+
} : void 0,
|
|
1528
|
+
e.$slots.optionTable ? {
|
|
1529
|
+
name: "optionTable",
|
|
1530
|
+
fn: b(() => [
|
|
1531
|
+
C(e.$slots, "optionTable", {}, void 0, !0)
|
|
1532
|
+
]),
|
|
1533
|
+
key: "5"
|
|
1534
|
+
} : void 0,
|
|
1535
|
+
e.$slots.optionLabels ? {
|
|
1536
|
+
name: "optionLabels",
|
|
1537
|
+
fn: b(() => [
|
|
1538
|
+
C(e.$slots, "optionLabels", {}, void 0, !0)
|
|
1539
|
+
]),
|
|
1540
|
+
key: "6"
|
|
1541
|
+
} : void 0,
|
|
1542
|
+
e.$slots.optionStack ? {
|
|
1543
|
+
name: "optionStack",
|
|
1544
|
+
fn: b(() => [
|
|
1545
|
+
C(e.$slots, "optionStack", {}, void 0, !0)
|
|
1546
|
+
]),
|
|
1547
|
+
key: "7"
|
|
1548
|
+
} : void 0,
|
|
1549
|
+
e.$slots.optionFullscreen ? {
|
|
1550
|
+
name: "optionFullscreen",
|
|
1551
|
+
fn: b(({ toggleFullscreen: l, isFullscreen: u }) => [
|
|
1552
|
+
C(e.$slots, "optionFullscreen", j(G({ toggleFullscreen: l, isFullscreen: u })), void 0, !0)
|
|
1553
|
+
]),
|
|
1554
|
+
key: "8"
|
|
1555
|
+
} : void 0,
|
|
1556
|
+
e.$slots.optionAnnotator ? {
|
|
1557
|
+
name: "optionAnnotator",
|
|
1558
|
+
fn: b(({ toggleAnnotator: l, isAnnotator: u }) => [
|
|
1559
|
+
C(e.$slots, "optionAnnotator", j(G({ toggleAnnotator: l, isAnnotator: u })), void 0, !0)
|
|
1560
|
+
]),
|
|
1561
|
+
key: "9"
|
|
1562
|
+
} : void 0,
|
|
1563
|
+
e.$slots.optionAltCopy ? {
|
|
1564
|
+
name: "optionAltCopy",
|
|
1565
|
+
fn: b(({ altCopy: l }) => [
|
|
1566
|
+
C(e.$slots, "optionAltCopy", j(G({ altCopy: l })), void 0, !0)
|
|
1567
|
+
]),
|
|
1568
|
+
key: "10"
|
|
1569
|
+
} : void 0
|
|
1570
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasAltCopy", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "tableDialog", "isCursorPointer", "onGeneratePdf", "style"])) : W("", !0),
|
|
1571
|
+
H("div", {
|
|
1572
|
+
class: "vue-ui-xy-canvas",
|
|
1573
|
+
style: ve(`position: relative; aspect-ratio: ${La.value}`),
|
|
1574
|
+
ref_key: "container",
|
|
1575
|
+
ref: ue
|
|
1576
|
+
}, [
|
|
1577
|
+
H("canvas", {
|
|
1578
|
+
ref_key: "canvas",
|
|
1579
|
+
ref: k,
|
|
1580
|
+
"aria-label": pt.value,
|
|
1581
|
+
"aria-describedby": `chart-instructions-${Z.value}`,
|
|
1582
|
+
role: "img",
|
|
1583
|
+
"aria-live": "polite",
|
|
1584
|
+
tabindex: "0",
|
|
1585
|
+
style: { width: "100%", height: "100%" },
|
|
1586
|
+
onMousemove: t[0] || (t[0] = (l) => Gt(l)),
|
|
1587
|
+
onMouseleave: tl,
|
|
1588
|
+
onFocus: Qt,
|
|
1589
|
+
onBlur: el,
|
|
1590
|
+
onKeydown: al
|
|
1591
|
+
}, null, 40, eo),
|
|
1592
|
+
e.$slots.hint ? (I(), $e("div", ao, [
|
|
1593
|
+
C(e.$slots, "hint", j(G({ hint: a.value.a11y.translations.keyboardNavigation, isVisible: Ke.value })), void 0, !0)
|
|
1594
|
+
])) : W("", !0),
|
|
1595
|
+
C(e.$slots, "skeleton", {}, () => [
|
|
1596
|
+
z(Oe) ? (I(), q(Ol, { key: 0 })) : W("", !0)
|
|
1597
|
+
], !0),
|
|
1598
|
+
et(z(it), {
|
|
1599
|
+
teleportTo: a.value.style.chart.tooltip.teleportTo,
|
|
1600
|
+
show: d.value.showTooltip && he.value,
|
|
1601
|
+
backgroundColor: a.value.style.chart.tooltip.backgroundColor,
|
|
1602
|
+
color: a.value.style.chart.tooltip.color,
|
|
1603
|
+
fontSize: a.value.style.chart.tooltip.fontSize,
|
|
1604
|
+
borderRadius: a.value.style.chart.tooltip.borderRadius,
|
|
1605
|
+
borderColor: a.value.style.chart.tooltip.borderColor,
|
|
1606
|
+
borderWidth: a.value.style.chart.tooltip.borderWidth,
|
|
1607
|
+
position: a.value.style.chart.tooltip.position,
|
|
1608
|
+
offsetY: a.value.style.chart.tooltip.offsetY,
|
|
1609
|
+
parent: e.$refs.xy,
|
|
1610
|
+
content: fe.value,
|
|
1611
|
+
isFullscreen: me.value,
|
|
1612
|
+
backgroundOpacity: a.value.style.chart.tooltip.backgroundOpacity,
|
|
1613
|
+
isCustom: z(ia)(a.value.style.chart.tooltip.customFormat),
|
|
1614
|
+
smooth: a.value.style.chart.tooltip.smooth,
|
|
1615
|
+
backdropFilter: a.value.style.chart.tooltip.backdropFilter,
|
|
1616
|
+
smoothForce: a.value.style.chart.tooltip.smoothForce,
|
|
1617
|
+
smoothSnapThreshold: a.value.style.chart.tooltip.smoothSnapThreshold,
|
|
1618
|
+
isA11yMode: Re.value,
|
|
1619
|
+
a11yPosition: pa.value
|
|
1620
|
+
}, {
|
|
1621
|
+
"tooltip-before": b(() => [
|
|
1622
|
+
C(e.$slots, "tooltip-before", j(G({ ...Me.value })), void 0, !0)
|
|
1623
|
+
]),
|
|
1624
|
+
tooltip: b(() => [
|
|
1625
|
+
C(e.$slots, "tooltip", j(G({ ...Me.value })), void 0, !0)
|
|
1626
|
+
]),
|
|
1627
|
+
"tooltip-after": b(() => [
|
|
1628
|
+
C(e.$slots, "tooltip-after", j(G({ ...Me.value })), void 0, !0)
|
|
1629
|
+
]),
|
|
1630
|
+
_: 3
|
|
1631
|
+
}, 8, ["teleportTo", "show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "position", "offsetY", "parent", "content", "isFullscreen", "backgroundOpacity", "isCustom", "smooth", "backdropFilter", "smoothForce", "smoothSnapThreshold", "isA11yMode", "a11yPosition"])
|
|
1632
|
+
], 4),
|
|
1633
|
+
a.value.style.chart.zoom.show && O.value > 6 && U.value && ga.value && !z(Oe) ? (I(), q(ql, {
|
|
1634
|
+
key: 2,
|
|
1635
|
+
ref_key: "chartSlicer",
|
|
1636
|
+
ref: ae,
|
|
1637
|
+
allMinimaps: It.value,
|
|
1638
|
+
background: a.value.style.chart.zoom.color,
|
|
1639
|
+
borderColor: a.value.style.chart.backgroundColor,
|
|
1640
|
+
customFormat: a.value.style.chart.zoom.customFormat,
|
|
1641
|
+
cutNullValues: Ee.value,
|
|
1642
|
+
enableRangeHandles: a.value.style.chart.zoom.enableRangeHandles,
|
|
1643
|
+
enableSelectionDrag: a.value.style.chart.zoom.enableSelectionDrag,
|
|
1644
|
+
end: s.value.end,
|
|
1645
|
+
focusOnDrag: a.value.style.chart.zoom.focusOnDrag,
|
|
1646
|
+
focusRangeRatio: a.value.style.chart.zoom.focusRangeRatio,
|
|
1647
|
+
fontSize: a.value.style.chart.zoom.fontSize,
|
|
1648
|
+
immediate: !a.value.style.chart.zoom.preview.enable,
|
|
1649
|
+
inputColor: a.value.style.chart.zoom.color,
|
|
1650
|
+
isPreview: Ft.value,
|
|
1651
|
+
labelLeft: a.value.style.chart.grid.x.timeLabels.values[s.value.start] ? w.value[s.value.start]?.text : "",
|
|
1652
|
+
labelRight: a.value.style.chart.grid.x.timeLabels.values[s.value.end - 1] ? w.value[s.value.end - 1]?.text : "",
|
|
1653
|
+
max: O.value,
|
|
1654
|
+
min: 0,
|
|
1655
|
+
minimap: At.value,
|
|
1656
|
+
minimapCompact: a.value.style.chart.zoom.minimap.compact,
|
|
1657
|
+
minimapFrameColor: a.value.style.chart.zoom.minimap.frameColor,
|
|
1658
|
+
minimapIndicatorColor: a.value.style.chart.zoom.minimap.indicatorColor,
|
|
1659
|
+
minimapLineColor: a.value.style.chart.zoom.minimap.lineColor,
|
|
1660
|
+
minimapMerged: a.value.style.chart.zoom.minimap.merged,
|
|
1661
|
+
minimapSelectedColor: a.value.style.chart.zoom.minimap.selectedColor,
|
|
1662
|
+
minimapSelectedColorOpacity: a.value.style.chart.zoom.minimap.selectedColorOpacity,
|
|
1663
|
+
minimapSelectedIndex: h.value,
|
|
1664
|
+
minimapSelectionRadius: a.value.style.chart.zoom.minimap.selectionRadius,
|
|
1665
|
+
preciseLabels: Na.value?.length ? Na.value : w.value,
|
|
1666
|
+
refreshEndPoint: a.value.style.chart.zoom.endIndex !== null ? a.value.style.chart.zoom.endIndex + 1 : O.value,
|
|
1667
|
+
refreshStartPoint: a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex : 0,
|
|
1668
|
+
selectColor: a.value.style.chart.zoom.highlightColor,
|
|
1669
|
+
selectedSeries: M.value,
|
|
1670
|
+
smoothMinimap: a.value.style.chart.zoom.minimap.smooth,
|
|
1671
|
+
start: s.value.start,
|
|
1672
|
+
timeLabels: w.value,
|
|
1673
|
+
usePreciseLabels: a.value.style.chart.grid.x.timeLabels.datetimeFormatter.enable && !a.value.style.chart.zoom.useDefaultFormat,
|
|
1674
|
+
textColor: a.value.style.chart.color,
|
|
1675
|
+
useResetSlot: a.value.style.chart.zoom.useResetSlot,
|
|
1676
|
+
valueEnd: s.value.end,
|
|
1677
|
+
valueStart: s.value.start,
|
|
1678
|
+
verticalHandles: a.value.style.chart.zoom.minimap.verticalHandles,
|
|
1679
|
+
maxWidth: a.value.style.chart.zoom.maxWidth,
|
|
1680
|
+
additionalMinimapHeight: a.value.style.chart.zoom.minimap.additionalHeight,
|
|
1681
|
+
handleType: a.value.style.chart.zoom.minimap.handleType,
|
|
1682
|
+
handleIconColor: a.value.style.chart.zoom.minimap.handleIconColor,
|
|
1683
|
+
handleBorderWidth: a.value.style.chart.zoom.minimap.handleBorderWidth,
|
|
1684
|
+
handleBorderColor: a.value.style.chart.zoom.minimap.handleBorderColor,
|
|
1685
|
+
handleFill: a.value.style.chart.zoom.minimap.handleFill,
|
|
1686
|
+
handleWidth: a.value.style.chart.zoom.minimap.handleWidth,
|
|
1687
|
+
onFutureEnd: t[1] || (t[1] = (l) => Ma("end", l)),
|
|
1688
|
+
onFutureStart: t[2] || (t[2] = (l) => Ma("start", l)),
|
|
1689
|
+
onReset: xe,
|
|
1690
|
+
onTrapMouse: wt,
|
|
1691
|
+
"onUpdate:end": Rt,
|
|
1692
|
+
"onUpdate:start": Pt
|
|
1693
|
+
}, {
|
|
1694
|
+
"reset-action": b(({ reset: l }) => [
|
|
1695
|
+
C(e.$slots, "reset-action", j(G({ reset: l })), void 0, !0)
|
|
1696
|
+
]),
|
|
1697
|
+
_: 3
|
|
1698
|
+
}, 8, ["allMinimaps", "background", "borderColor", "customFormat", "cutNullValues", "enableRangeHandles", "enableSelectionDrag", "end", "focusOnDrag", "focusRangeRatio", "fontSize", "immediate", "inputColor", "isPreview", "labelLeft", "labelRight", "max", "minimap", "minimapCompact", "minimapFrameColor", "minimapIndicatorColor", "minimapLineColor", "minimapMerged", "minimapSelectedColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapSelectionRadius", "preciseLabels", "refreshEndPoint", "refreshStartPoint", "selectColor", "selectedSeries", "smoothMinimap", "start", "timeLabels", "usePreciseLabels", "textColor", "useResetSlot", "valueEnd", "valueStart", "verticalHandles", "maxWidth", "additionalMinimapHeight", "handleType", "handleIconColor", "handleBorderWidth", "handleBorderColor", "handleFill", "handleWidth"])) : W("", !0),
|
|
1699
|
+
H("div", {
|
|
1700
|
+
id: `legend-bottom-${Z.value}`
|
|
1701
|
+
}, null, 8, to),
|
|
1702
|
+
ya.value ? (I(), q(hl, {
|
|
1703
|
+
key: 3,
|
|
1704
|
+
to: a.value.style.chart.legend.position === "top" ? `#legend-top-${Z.value}` : `#legend-bottom-${Z.value}`
|
|
1705
|
+
}, [
|
|
1706
|
+
H("div", {
|
|
1707
|
+
ref_key: "chartLegend",
|
|
1708
|
+
ref: fa
|
|
1709
|
+
}, [
|
|
1710
|
+
a.value.style.chart.legend.show && U.value ? (I(), q(_l, {
|
|
1711
|
+
legendSet: We.value,
|
|
1712
|
+
config: ul.value,
|
|
1713
|
+
key: `legend_${je.value}`,
|
|
1714
|
+
isCursorPointer: le.value,
|
|
1715
|
+
onClickMarker: t[3] || (t[3] = ({ i: l }) => He(l))
|
|
1716
|
+
}, {
|
|
1717
|
+
item: b(({ legend: l, index: u }) => [
|
|
1718
|
+
H("div", {
|
|
1719
|
+
onClick: (n) => l.segregate(),
|
|
1720
|
+
style: ve(`opacity:${p.value.includes(u) ? 0.5 : 1}`)
|
|
1721
|
+
}, Ae(l.name), 13, lo)
|
|
1722
|
+
]),
|
|
1723
|
+
legendToggle: b(() => [
|
|
1724
|
+
We.value.length > 2 && a.value.style.chart.legend.selectAllToggle.show && !z(Oe) ? (I(), q(jl, {
|
|
1725
|
+
key: 0,
|
|
1726
|
+
backgroundColor: a.value.style.chart.legend.selectAllToggle.backgroundColor,
|
|
1727
|
+
color: a.value.style.chart.legend.selectAllToggle.color,
|
|
1728
|
+
fontSize: a.value.style.chart.legend.fontSize,
|
|
1729
|
+
checked: p.value.length > 0,
|
|
1730
|
+
isCursorPointer: le.value,
|
|
1731
|
+
onToggle: ll
|
|
1732
|
+
}, null, 8, ["backgroundColor", "color", "fontSize", "checked", "isCursorPointer"])) : W("", !0)
|
|
1733
|
+
]),
|
|
1734
|
+
_: 1
|
|
1735
|
+
}, 8, ["legendSet", "config", "isCursorPointer"])) : C(e.$slots, "legend", {
|
|
1736
|
+
key: 1,
|
|
1737
|
+
legend: We.value
|
|
1738
|
+
}, void 0, !0)
|
|
1739
|
+
], 512)
|
|
1740
|
+
], 8, ["to"])) : W("", !0),
|
|
1741
|
+
e.$slots.watermark ? (I(), $e("div", oo, [
|
|
1742
|
+
C(e.$slots, "watermark", j(G({ isPrinting: z(Ca) || z(ka) || Ze.value })), void 0, !0)
|
|
1743
|
+
])) : W("", !0),
|
|
1744
|
+
e.$slots.source ? (I(), $e("div", {
|
|
1745
|
+
key: 5,
|
|
1746
|
+
ref_key: "source",
|
|
1747
|
+
ref: ma,
|
|
1748
|
+
dir: "auto"
|
|
1749
|
+
}, [
|
|
1750
|
+
C(e.$slots, "source", {}, void 0, !0)
|
|
1751
|
+
], 512)) : W("", !0),
|
|
1752
|
+
U.value && a.value.userOptions.buttons.table ? (I(), q(fl(Se.value.component), ml({ key: 6 }, Se.value.props, {
|
|
1753
|
+
ref_key: "tableUnit",
|
|
1754
|
+
ref: ye,
|
|
1755
|
+
onClose: Za
|
|
1756
|
+
}), Qa({
|
|
1757
|
+
content: b(() => [
|
|
1758
|
+
(I(), q(z(vt), {
|
|
1759
|
+
key: `table_${qe.value}`,
|
|
1760
|
+
colNames: Xe.value.colNames,
|
|
1761
|
+
head: Xe.value.head,
|
|
1762
|
+
body: Xe.value.body,
|
|
1763
|
+
config: Xe.value.config,
|
|
1764
|
+
title: a.value.table.useDialog ? "" : Se.value.title,
|
|
1765
|
+
withCloseButton: !a.value.table.useDialog,
|
|
1766
|
+
isCursorPointer: le.value,
|
|
1767
|
+
onClose: Za
|
|
1768
|
+
}, {
|
|
1769
|
+
th: b(({ th: l }) => [
|
|
1770
|
+
H("div", { innerHTML: l }, null, 8, so)
|
|
1771
|
+
]),
|
|
1772
|
+
td: b(({ td: l }) => [
|
|
1773
|
+
at(Ae(l), 1)
|
|
1774
|
+
]),
|
|
1775
|
+
_: 1
|
|
1776
|
+
}, 8, ["colNames", "head", "body", "config", "title", "withCloseButton", "isCursorPointer"]))
|
|
1777
|
+
]),
|
|
1778
|
+
_: 2
|
|
1779
|
+
}, [
|
|
1780
|
+
a.value.table.useDialog ? {
|
|
1781
|
+
name: "title",
|
|
1782
|
+
fn: b(() => [
|
|
1783
|
+
at(Ae(Se.value.title), 1)
|
|
1784
|
+
]),
|
|
1785
|
+
key: "0"
|
|
1786
|
+
} : void 0,
|
|
1787
|
+
a.value.table.useDialog ? {
|
|
1788
|
+
name: "actions",
|
|
1789
|
+
fn: b(() => [
|
|
1790
|
+
H("button", {
|
|
1791
|
+
tabindex: "0",
|
|
1792
|
+
class: "vue-ui-user-options-button",
|
|
1793
|
+
onClick: t[4] || (t[4] = (l) => la(a.value.userOptions.callbacks.csv)),
|
|
1794
|
+
style: ve({ cursor: le.value ? "pointer" : "default" })
|
|
1795
|
+
}, [
|
|
1796
|
+
et(Ul, {
|
|
1797
|
+
name: "fileCsv",
|
|
1798
|
+
stroke: Se.value.props.color
|
|
1799
|
+
}, null, 8, ["stroke"])
|
|
1800
|
+
], 4)
|
|
1801
|
+
]),
|
|
1802
|
+
key: "1"
|
|
1803
|
+
} : void 0
|
|
1804
|
+
]), 1040)) : W("", !0),
|
|
1805
|
+
a.value.userOptions.buttons.annotator && f.value.length ? (I(), q(z(dt), {
|
|
1806
|
+
key: 7,
|
|
1807
|
+
parent: K.value,
|
|
1808
|
+
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1809
|
+
color: a.value.style.chart.color,
|
|
1810
|
+
active: we.value,
|
|
1811
|
+
isCursorPointer: le.value,
|
|
1812
|
+
onClose: oa
|
|
1813
|
+
}, null, 8, ["parent", "backgroundColor", "color", "active", "isCursorPointer"])) : W("", !0)
|
|
1814
|
+
], 46, Zl));
|
|
1815
|
+
}
|
|
1816
|
+
}, $o = /* @__PURE__ */ Gl(uo, [["__scopeId", "data-v-e2e8179a"]]);
|
|
1817
|
+
export {
|
|
1818
|
+
$o as default
|
|
1819
|
+
};
|