vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2,891 lines • 148 kB
JavaScript
import { P as H, W as q, a6 as j, c as X, A as $, F as ee, w as te, s as le, o as ae, _ as re, a7 as ie, x as se, C as ne, y as ce, a4 as oe, e as he, r as ue, f as U, a8 as de, R as ge, S as fe, q as Ie, b as me, z as Ne, d as xe, a9 as be, v as Fe, aa as _e, a2 as ye, ab as Ae, i as Le, G as Ce, L as Se, u as ke, p as we, B as Oe, a as Ge, t as ve } from "./index-BaaDnc4F.js";
import { D as pe } from "./DataTable-DvwmNjb-.js";
import { _ as Me } from "./Title-D_MGglyN.js";
import { u as ze, _ as Te } from "./Tooltip-HRgkF8HD.js";
import { U as Pe } from "./usePrinter-y4-4tCWT.js";
import { _ as Ve } from "./Shape-BuwIrUMv.js";
import Re from "./BaseIcon-rw8rKNKS.js";
import He from "./vue-ui-table-sparkline-BKDgWukC.js";
import De from "./vue-ui-skeleton-6RiQNJSb.js";
import { S as Be } from "./Slicer-CUm2ijlc.js";
import Ee from "./vue-ui-accordion-CF9kQTXq.js";
import { u as Z } from "./useNestedProp-D8vQcOps.js";
import { _ as We } from "./PackageVersion-D9Lm1C1X.js";
import { P as Ye } from "./PenAndPaper-DR58HO_U.js";
import { resolveComponent as R, createElementBlock as i, openBlock as r, normalizeStyle as x, normalizeClass as B, createBlock as D, createCommentVNode as u, createVNode as Y, createSlots as qe, withCtx as P, renderSlot as S, normalizeProps as E, guardReactiveProps as W, createElementVNode as f, createTextVNode as J, Fragment as d, renderList as I, toDisplayString as T, mergeProps as K, withDirectives as Xe, vModelCheckbox as Ue } from "vue";
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Je = X(), Ke = {
name: "vue-ui-xy",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
components: {
DataTable: pe,
Shape: Ve,
Title: Me,
Tooltip: Te,
UserOptions: Pe,
BaseIcon: Re,
TableSparkline: He,
Skeleton: De,
Slicer: Be,
Accordion: Ee,
PackageVersion: We,
PenAndPaper: Ye
},
data() {
this.dataset.forEach((g, l) => {
[null, void 0].includes(g.series) && this.error({
componentName: "VueUiXy",
type: "datasetSerieAttribute",
property: "series (number[])",
index: l
});
});
const t = this.config.downsample && this.config.downsample.threshold ? this.config.downsample.threshold : 500, s = Math.max(...this.dataset.map((g) => this.largestTriangleThreeBucketsArray({ data: g.series, threshold: t }).length)), o = {
start: 0,
end: s
};
return {
themePalettes: ve,
themes: Ge,
slicerStep: 0,
selectedScale: null,
CTX: null,
CANVAS: null,
opacity: Oe,
useSafeValues: !0,
palette: we,
height: 600,
width: 1e3,
viewBox: "0 0 1000 600",
clientPosition: {
x: 0,
y: 0
},
canvasClientPosition: {
x: 0,
y: 0
},
icons: {
line: "line",
bar: "bar",
plot: "plot"
},
isAnnotator: !1,
isFullscreen: !1,
isPrinting: !1,
isImaging: !1,
isTooltip: !1,
mutableConfig: {
dataLabels: {
show: !0
},
showTooltip: !0,
showTable: !1,
isStacked: !1,
useIndividualScale: !1
},
selectedSerieIndex: null,
selectedRowIndex: null,
segregatedSeries: [],
uniqueId: X(),
step: 0,
tableStep: 0,
titleStep: 0,
slicer: o,
__to__: null,
maxX: s,
showSparklineTable: !0,
segregateStep: 0,
sliderId: Je,
fontSizes: {
xAxis: 18,
yAxis: 12,
dataLabels: 20,
plotLabels: 10
},
plotRadii: {
plot: 3,
line: 3
},
selectedMinimapIndex: null,
showUserOptionsOnChartHover: !1,
keepUserOptionState: !0,
userOptionsVisible: !0,
svgRef: null,
tagRefs: {}
};
},
watch: {
dataset: {
handler(t, s) {
this.maxX = Math.max(...this.dataset.map((o) => this.largestTriangleThreeBucketsArray({
data: o.series,
threshold: this.FINAL_CONFIG.downsample.threshold
}).length)), this.slicer = {
start: 0,
end: this.maxX
}, this.slicerStep += 1, this.segregateStep += 1;
},
deep: !0
},
config: {
handler(t, s) {
this.FINAL_CONFIG = this.prepareConfig(), this.prepareChart(), this.titleStep += 1, this.tableStep += 1, this.mutableConfig = {
dataLabels: {
show: !0
},
showTooltip: this.FINAL_CONFIG.chart.tooltip.show === !0,
showTable: this.FINAL_CONFIG.showTable === !0,
isStacked: this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked,
useIndividualScale: this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale
};
},
deep: !0
}
},
computed: {
chartAriaLabel() {
const t = this.FINAL_CONFIG.chart.title.text || "Chart visualization", s = this.FINAL_CONFIG.chart.title.subtitle.text || "";
return `${t}. ${s}`;
},
optimize() {
return {
linePlot: this.maxSeries > this.FINAL_CONFIG.line.dot.hideAboveMaxSerieLength
};
},
hasOptionsNoTitle() {
return this.FINAL_CONFIG.chart.userOptions.show && (!this.FINAL_CONFIG.chart.title.show || !this.FINAL_CONFIG.chart.title.text);
},
minimap() {
if (!this.FINAL_CONFIG.chart.zoom.minimap.show) return [];
const t = this.datasetWithIds.filter((l) => !this.segregatedSeries.includes(l.id)), s = Math.max(...t.map((l) => l.series.length)), o = [];
for (let l = 0; l < s; l += 1)
o.push(t.map((e) => e.series[l] || 0).reduce((e, A) => (e || 0) + (A || 0), 0));
const g = Math.min(...o);
return o.map((l) => l + (g < 0 ? Math.abs(g) : 0));
},
customPalette() {
return this.convertCustomPalette(this.FINAL_CONFIG.customPalette);
},
backgroundColor() {
return this.FINAL_CONFIG.chart.backgroundColor;
},
slicerColor() {
return this.FINAL_CONFIG.chart.zoom.color;
},
allScales() {
const t = this.lineSet.map((e) => ({
name: e.name,
color: e.color,
scale: e.individualScale,
scaleYLabels: e.scaleYLabels,
zero: e.zeroPosition,
max: e.individualMax,
scaleLabel: e.scaleLabel || "",
id: e.id,
yOffset: e.yOffset || 0,
individualHeight: e.individualHeight || this.drawingArea.height,
autoScaleYLabels: e.autoScaleYLabels
})), s = this.barSet.map((e) => ({
name: e.name,
color: e.color,
scale: e.individualScale,
scaleYLabels: e.scaleYLabels,
zero: e.zeroPosition,
max: e.individualMax,
scaleLabel: e.scaleLabel || "",
id: e.id,
yOffset: e.yOffset || 0,
individualHeight: e.individualHeight || this.drawingArea.height
})), o = this.plotSet.map((e) => ({
name: e.name,
color: e.color,
scale: e.individualScale,
scaleYLabels: e.scaleYLabels,
// FIX
zero: e.zeroPosition,
max: e.individualMax,
scaleLabel: e.scaleLabel || "",
id: e.id,
yOffset: e.yOffset || 0,
individualHeight: e.individualHeight || this.drawingArea.height
})), g = this.mutableConfig.useIndividualScale && !this.mutableConfig.isStacked ? Object.values(this.scaleGroups) : [...t, ...s, ...o], l = g.flatMap((e) => e).length;
return g.flatMap((e, A) => ({
unique: e.unique,
id: e.id,
groupId: e.groupId,
scaleLabel: e.scaleLabel,
name: this.mutableConfig.useIndividualScale && !this.mutableConfig.isStacked ? e.unique ? e.name : e.groupName : e.name,
color: this.mutableConfig.useIndividualScale && !this.mutableConfig.isStacked ? e.unique ? e.color : e.groupColor : e.color,
scale: e.scale,
yOffset: e.yOffset,
individualHeight: e.individualHeight,
x: this.mutableConfig.isStacked ? this.drawingArea.left : this.drawingArea.left / l * (A + 1),
yLabels: e.scaleYLabels || e.scale.ticks.map((N) => ({
y: N >= 0 ? e.zero - e.individualHeight * (N / e.max) : e.zero + e.individualHeight * Math.abs(N) / e.max,
value: N
}))
}));
},
isDataset() {
return !!this.dataset && this.dataset.length;
},
chartFont() {
const t = document.getElementById(`vue-ui-xy_${this.uniqueId}`);
return window.getComputedStyle(t, null).getPropertyValue("font-family");
},
FINAL_CONFIG: {
get: function() {
return this.prepareConfig();
},
set: function(t) {
return t;
}
},
hasHighlightArea() {
return Array.isArray(this.FINAL_CONFIG.chart.highlightArea) ? this.FINAL_CONFIG.chart.highlightArea.some((t) => t.show) : this.FINAL_CONFIG.chart.highlightArea && this.FINAL_CONFIG.chart.highlightArea.show;
},
highlightAreas() {
if (Array.isArray(this.FINAL_CONFIG.chart.highlightArea))
return this.FINAL_CONFIG.chart.highlightArea.map((s) => ({
...s,
span: s.from === s.to ? 1 : s.to < s.from ? 0 : s.to - s.from + 1
}));
const t = this.FINAL_CONFIG.chart.highlightArea;
return [{ ...t, span: t.from === t.to ? 1 : t.to < t.from ? 0 : t.to - t.from + 1 }];
},
xPadding() {
return this.FINAL_CONFIG.chart.grid.position === "middle" ? 0 : this.drawingArea.width / this.maxSeries / 2;
},
relativeZero() {
return [null, void 0].includes(this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMin) ? this.niceScale.min >= 0 ? 0 : Math.abs(this.niceScale.min) : -this.niceScale.min;
},
absoluteMax() {
return this.niceScale.max + this.relativeZero;
},
datasetWithIds() {
return this.useSafeValues ? this.dataset.map((t, s) => ({
...t,
series: this.largestTriangleThreeBucketsArray({
data: t.series,
threshold: this.FINAL_CONFIG.downsample.threshold
}),
id: `uniqueId_${s}`
})) : this.dataset;
},
safeDataset() {
return this.useSafeValues ? this.dataset.map((t, s) => {
const o = this.largestTriangleThreeBucketsArray({
data: t.series,
threshold: this.FINAL_CONFIG.downsample.threshold
}), g = `uniqueId_${s}`;
return {
...t,
slotAbsoluteIndex: s,
series: o.map((l) => this.isSafeValue(l) ? l : null).slice(this.slicer.start, this.slicer.end),
color: this.convertColorToHex(t.color ? t.color : this.customPalette[s] ? this.customPalette[s] : this.palette[s]),
id: g,
scaleLabel: t.scaleLabel || g
};
}) : this.dataset;
},
relativeDataset() {
return this.safeDataset.map((t, s) => ({
...t,
series: t.series.map((o) => o + this.relativeZero),
absoluteValues: t.series
})).filter((t) => !this.segregatedSeries.includes(t.id));
},
tableSparklineDataset() {
return this.relativeDataset.map((t) => {
const s = t.absoluteValues.map((o) => [void 0, null].includes(o) ? 0 : o);
return {
id: t.id,
name: t.name,
color: t.color,
values: this.fillArray(this.maxSeries, s)
};
});
},
tableSparklineConfig() {
return {
responsiveBreakpoint: this.FINAL_CONFIG.table.responsiveBreakpoint,
roundingValues: this.FINAL_CONFIG.table.rounding,
showAverage: !1,
showMedian: !1,
showTotal: !1,
fontFamily: this.FINAL_CONFIG.chart.fontFamily,
prefix: this.FINAL_CONFIG.chart.labels.prefix,
suffix: this.FINAL_CONFIG.chart.labels.suffix,
colNames: JSON.parse(JSON.stringify(this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values)),
thead: {
backgroundColor: this.FINAL_CONFIG.table.th.backgroundColor,
color: this.FINAL_CONFIG.table.th.color,
outline: this.FINAL_CONFIG.table.th.outline
},
tbody: {
backgroundColor: this.FINAL_CONFIG.table.td.backgroundColor,
color: this.FINAL_CONFIG.table.td.color,
outline: this.FINAL_CONFIG.table.td.outline
},
userOptions: {
show: !1
}
};
},
absoluteDataset() {
return this.safeDataset.map((t, s) => ({
absoluteIndex: s,
...t,
series: t.series.map((o) => o + this.relativeZero),
absoluteValues: t.series,
segregate: () => this.segregate(t),
isSegregated: this.segregatedSeries.includes(t.id)
}));
},
activeSeriesLength() {
return this.absoluteDataset.length;
},
activeSeriesWithStackRatios() {
return this.assignStackRatios(this.absoluteDataset.filter((t) => !this.segregatedSeries.includes(t.id)));
},
scaleGroups() {
const t = Object.groupBy(this.activeSeriesWithStackRatios, (o) => o.scaleLabel), s = {};
for (const [o, g] of Object.entries(t)) {
const l = g.flatMap((e) => e.absoluteValues);
s[o] = {
min: Math.min(...l) || 0,
max: Math.max(...l) || 1,
groupId: `scale_group_${this.createUid()}`
};
}
return s;
},
barSet() {
return this.activeSeriesWithStackRatios.filter((t) => t.type === "bar").map((t, s) => {
this.checkAutoScaleError(t);
const o = this.scaleGroups[t.scaleLabel].min, g = this.scaleGroups[t.scaleLabel].max;
t.absoluteValues.filter((_) => ![null, void 0].includes(_)).map((_) => (_ - o) / (g - o));
const l = {
valueMin: o,
valueMax: g < 0 ? 0 : g
}, e = {
max: t.scaleMax || Math.max(...t.absoluteValues) || 1,
min: t.scaleMin || Math.min(...t.absoluteValues.filter((_) => ![void 0, null].includes(_))) > 0 ? 0 : Math.min(...t.absoluteValues.filter((_) => ![null, void 0].includes(_)))
}, A = t.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps, N = 1.0000001, m = this.calculateNiceScaleWithExactExtremes(e.min, e.max === e.min ? e.max * N : e.max, A), L = this.calculateNiceScaleWithExactExtremes(l.valueMin, l.valueMax === l.valueMin ? l.valueMax * N : l.valueMax, A), G = m.min >= 0 ? 0 : Math.abs(m.min), w = 0, v = m.max + G, O = L.max + Math.abs(w), b = this.mutableConfig.isStacked ? this.drawingArea.height * (1 - t.cumulatedStackRatio) : 0, C = this.mutableConfig.isStacked ? this.drawingArea.height * t.stackRatio - this.FINAL_CONFIG.chart.grid.labels.yAxis.gap : this.drawingArea.height, p = this.drawingArea.bottom - b - C * G / v, V = this.drawingArea.bottom - b - C * w / O, a = this.absoluteDataset.filter((_) => _.type === "bar").filter((_) => !this.segregatedSeries.includes(_.id)).length, c = t.series.map((_, z) => {
const y = this.mutableConfig.useIndividualScale ? (t.absoluteValues[z] + G) / v : this.ratioToMax(_), k = this.mutableConfig.useIndividualScale && this.mutableConfig.isStacked ? this.drawingArea.left + this.drawingArea.width / this.maxSeries * z : this.drawingArea.left + this.slot.bar * s + this.slot.bar * z * a - this.barSlot / 2 - s * this.barPeriodGap;
return {
yOffset: this.checkNaN(b),
individualHeight: this.checkNaN(C),
x: this.checkNaN(k),
y: this.drawingArea.bottom - b - C * y,
value: t.absoluteValues[z],
zeroPosition: this.checkNaN(p),
individualMax: this.checkNaN(v),
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[z] || ""
};
}), n = t.absoluteValues.map((_) => L.min >= 0 ? (_ - Math.abs(L.min)) / (L.max - Math.abs(L.min)) : (_ + Math.abs(L.min)) / (L.max + Math.abs(L.min))), h = t.series.map((_, z) => {
const y = this.mutableConfig.useIndividualScale && this.mutableConfig.isStacked ? this.drawingArea.left + this.drawingArea.width / this.maxSeries * z : this.drawingArea.left - this.slot.bar / 2 + this.slot.bar * s + this.slot.bar * z * this.absoluteDataset.filter((k) => k.type === "bar").filter((k) => !this.segregatedSeries.includes(k.id)).length;
return {
yOffset: this.checkNaN(b),
individualHeight: this.checkNaN(C),
x: this.checkNaN(y),
y: this.checkNaN(this.drawingArea.bottom - this.checkNaN(b) - (this.checkNaN(C) * n[z] || 0)),
value: t.absoluteValues[z],
zeroPosition: this.checkNaN(p),
individualMax: this.checkNaN(v),
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[z] || ""
};
}), F = m.ticks.map((_) => ({
y: _ >= 0 ? p - C * (_ / v) : p + C * Math.abs(_) / v,
value: _,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
})), M = L.ticks.map((_) => {
const z = (_ - L.min) / (L.max - L.min);
return {
y: _ >= 0 ? V - C * z : V + C * z,
value: _,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
};
});
return this.scaleGroups[t.scaleLabel].name = t.name, this.scaleGroups[t.scaleLabel].groupName = t.scaleLabel, this.scaleGroups[t.scaleLabel].groupColor = this.FINAL_CONFIG.chart.grid.labels.yAxis.groupColor || t.color, this.scaleGroups[t.scaleLabel].color = t.color, this.scaleGroups[t.scaleLabel].scaleYLabels = t.autoScaling ? M : F, this.scaleGroups[t.scaleLabel].zeroPosition = t.autoScaling ? V : p, this.scaleGroups[t.scaleLabel].individualMax = t.autoScaling ? O : v, this.scaleGroups[t.scaleLabel].scaleLabel = t.scaleLabel, this.scaleGroups[t.scaleLabel].id = t.id, this.scaleGroups[t.scaleLabel].yOffset = b, this.scaleGroups[t.scaleLabel].individualHeight = C, this.scaleGroups[t.scaleLabel].autoScaleYLabels = M, this.scaleGroups[t.scaleLabel].unique = this.activeSeriesWithStackRatios.filter((_) => _.scaleLabel === t.scaleLabel).length === 1, {
...t,
yOffset: b,
autoScaleYLabels: M,
individualHeight: C,
scaleYLabels: t.autoScaling ? M : F,
individualScale: t.autoScaling ? L : m,
individualMax: t.autoScaling ? O : v,
zeroPosition: t.autoScaling ? V : p,
plots: t.autoScaling ? h : c,
groupId: this.scaleGroups[t.scaleLabel].groupId
};
});
},
lineSet() {
return this.activeSeriesWithStackRatios.filter((t) => t.type === "line").map((t) => {
this.checkAutoScaleError(t);
const s = this.scaleGroups[t.scaleLabel].min, o = this.scaleGroups[t.scaleLabel].max;
t.absoluteValues.filter((y) => ![null, void 0].includes(y)).map((y) => (y - s) / (o - s));
const g = {
valueMin: s,
valueMax: o
}, l = {
max: t.scaleMax || Math.max(...t.absoluteValues) || 1,
min: t.scaleMin || (Math.min(...t.absoluteValues) > 0 ? 0 : Math.min(...t.absoluteValues))
}, e = t.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps, A = 1.0000001, N = this.calculateNiceScaleWithExactExtremes(l.min, l.max === l.min ? l.max * A : l.max, e), m = this.calculateNiceScaleWithExactExtremes(g.valueMin, g.valueMax === g.valueMin ? g.valueMax * A : g.valueMax, e), L = N.min >= 0 ? 0 : Math.abs(N.min), G = 0, w = N.max + Math.abs(L), v = m.max + Math.abs(G), O = this.mutableConfig.isStacked ? this.drawingArea.height * (1 - t.cumulatedStackRatio) : 0, b = this.mutableConfig.isStacked ? this.drawingArea.height * t.stackRatio - this.FINAL_CONFIG.chart.grid.labels.yAxis.gap : this.drawingArea.height, C = this.drawingArea.bottom - O - b * L / w, p = this.drawingArea.bottom - O - b * G / v, V = t.series.map((y, k) => {
const Q = this.mutableConfig.useIndividualScale ? (t.absoluteValues[k] + Math.abs(L)) / w : this.ratioToMax(y);
return {
x: this.checkNaN(this.drawingArea.left + this.slot.line / 2 + this.slot.line * k),
y: this.checkNaN(this.drawingArea.bottom - O - b * Q),
value: t.absoluteValues[k],
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[k] || ""
};
}), a = t.absoluteValues.map((y) => m.min >= 0 ? (y - Math.abs(m.min)) / (m.max - Math.abs(m.min)) : (y + Math.abs(m.min)) / (m.max + Math.abs(m.min))), c = t.series.map((y, k) => [void 0, null].includes(t.absoluteValues[k]) ? {
x: this.checkNaN(this.drawingArea.left + this.slot.line / 2 + this.slot.line * k),
y: C,
value: t.absoluteValues[k],
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[k] || ""
} : {
x: this.checkNaN(this.drawingArea.left + this.slot.line / 2 + this.slot.line * k),
y: this.checkNaN(this.drawingArea.bottom - O - (b * a[k] || 0)),
value: t.absoluteValues[k],
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[k] || ""
}), n = this.createSmoothPath(V.filter((y) => y.value !== null)), h = this.createSmoothPath(c.filter((y) => y.value !== null)), F = this.createStraightPath(V.filter((y) => y.value !== null)), M = this.createStraightPath(c.filter((y) => y.value !== null)), _ = N.ticks.map((y) => ({
y: y >= 0 ? C - b * (y / w) : C + b * Math.abs(y) / w,
value: y,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
})), z = m.ticks.map((y) => {
const k = (y - m.min) / (m.max - m.min);
return {
y: y >= 0 ? p - b * k : p + b * k,
value: y,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
};
});
return this.scaleGroups[t.scaleLabel].name = t.name, this.scaleGroups[t.scaleLabel].groupName = t.scaleLabel, this.scaleGroups[t.scaleLabel].groupColor = this.FINAL_CONFIG.chart.grid.labels.yAxis.groupColor || t.color, this.scaleGroups[t.scaleLabel].color = t.color, this.scaleGroups[t.scaleLabel].scaleYLabels = t.autoScaling ? z : _, this.scaleGroups[t.scaleLabel].zeroPosition = t.autoScaling ? p : C, this.scaleGroups[t.scaleLabel].individualMax = t.autoScaling ? v : w, this.scaleGroups[t.scaleLabel].scaleLabel = t.scaleLabel, this.scaleGroups[t.scaleLabel].id = t.id, this.scaleGroups[t.scaleLabel].yOffset = O, this.scaleGroups[t.scaleLabel].individualHeight = b, this.scaleGroups[t.scaleLabel].autoScaleYLabels = z, this.scaleGroups[t.scaleLabel].unique = this.activeSeriesWithStackRatios.filter((y) => y.scaleLabel === t.scaleLabel).length === 1, {
...t,
yOffset: O,
autoScaleYLabels: z,
individualHeight: b,
scaleYLabels: t.autoScaling ? z : _,
individualScale: t.autoScaling ? m : N,
individualMax: t.autoScaling ? v : w,
zeroPosition: t.autoScaling ? p : C,
curve: t.autoScaling ? h : n,
plots: t.autoScaling ? c : V,
area: t.useArea ? this.mutableConfig.useIndividualScale ? this.createIndividualArea(t.autoScaling ? c : V, t.autoScaling ? p : C) : this.createArea(V) : "",
straight: t.autoScaling ? M : F,
groupId: this.scaleGroups[t.scaleLabel].groupId
};
});
},
plotSet() {
return this.activeSeriesWithStackRatios.filter((t) => t.type === "plot").map((t) => {
this.checkAutoScaleError(t);
const s = this.scaleGroups[t.scaleLabel].min, o = this.scaleGroups[t.scaleLabel].max;
t.absoluteValues.filter((F) => ![null, void 0].includes(F)).map((F) => (F - s) / (o - s));
const g = {
valueMin: s,
valueMax: o
}, l = {
max: t.scaleMax || Math.max(...t.absoluteValues) || 1,
min: t.scaleMin || Math.min(...t.absoluteValues) > 0 ? 0 : Math.min(...t.absoluteValues)
}, e = t.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps, A = 1.0000001, N = this.calculateNiceScaleWithExactExtremes(l.min, l.max === l.min ? l.max * A : l.max, e), m = this.calculateNiceScaleWithExactExtremes(g.valueMin, g.valueMax === g.valueMin ? g.valueMax * A : g.valueMax, e), L = N.min >= 0 ? 0 : Math.abs(N.min), G = 0, w = N.max + L, v = m.max + Math.abs(G), O = this.mutableConfig.isStacked ? this.drawingArea.height * (1 - t.cumulatedStackRatio) : 0, b = this.mutableConfig.isStacked ? this.drawingArea.height * t.stackRatio - this.FINAL_CONFIG.chart.grid.labels.yAxis.gap : this.drawingArea.height, C = this.drawingArea.bottom - O - b * L / w, p = this.drawingArea.bottom - O - b * G / v, V = t.series.map((F, M) => {
const _ = this.mutableConfig.useIndividualScale ? (t.absoluteValues[M] + Math.abs(L)) / w : this.ratioToMax(F);
return {
x: this.checkNaN(this.drawingArea.left + this.slot.plot / 2 + this.slot.plot * M),
y: this.checkNaN(this.drawingArea.bottom - O - b * _),
value: t.absoluteValues[M],
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[M] || ""
};
}), a = t.absoluteValues.map((F) => m.min >= 0 ? (F - Math.abs(m.min)) / (m.max - Math.abs(m.min)) : (F + Math.abs(m.min)) / (m.max + Math.abs(m.min))), c = t.series.map((F, M) => ({
x: this.checkNaN(this.drawingArea.left + this.slot.plot / 2 + this.slot.plot * M),
y: this.checkNaN(this.drawingArea.bottom - O - (b * a[M] || 0)),
value: t.absoluteValues[M],
comment: t.comments && t.comments.slice(this.slicer.start, this.slicer.end)[M] || ""
})), n = N.ticks.map((F) => ({
y: F >= 0 ? C - b * (F / w) : C + b * Math.abs(F) / w,
value: F,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
})), h = m.ticks.map((F) => {
const M = (F - m.min) / (m.max - m.min);
return {
y: F >= 0 ? p - b * M : p + b * M,
value: F,
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix,
datapoint: t
};
});
return this.scaleGroups[t.scaleLabel].name = t.name, this.scaleGroups[t.scaleLabel].groupName = t.scaleLabel, this.scaleGroups[t.scaleLabel].groupColor = this.FINAL_CONFIG.chart.grid.labels.yAxis.groupColor || t.color, this.scaleGroups[t.scaleLabel].color = t.color, this.scaleGroups[t.scaleLabel].scaleYLabels = t.autoScaling ? h : n, this.scaleGroups[t.scaleLabel].zeroPosition = t.autoScaling ? p : C, this.scaleGroups[t.scaleLabel].individualMax = t.autoScaling ? v : w, this.scaleGroups[t.scaleLabel].scaleLabel = t.scaleLabel, this.scaleGroups[t.scaleLabel].id = t.id, this.scaleGroups[t.scaleLabel].yOffset = O, this.scaleGroups[t.scaleLabel].individualHeight = b, this.scaleGroups[t.scaleLabel].autoScaleYLabels = h, this.scaleGroups[t.scaleLabel].unique = this.activeSeriesWithStackRatios.filter((F) => F.scaleLabel === t.scaleLabel).length === 1, {
...t,
yOffset: O,
autoScaleYLabels: h,
individualHeight: b,
scaleYLabels: t.autoScaling ? h : n,
individualScale: t.autoScaling ? m : N,
individualMax: t.autoScaling ? v : w,
zeroPosition: t.autoScaling ? p : C,
plots: t.autoScaling ? c : V,
groupId: this.scaleGroups[t.scaleLabel].groupId
};
});
},
drawingArea() {
function t(g) {
const l = /* @__PURE__ */ new Set();
return g.forEach((e) => {
const A = e.scaleLabel || "__noScaleLabel__";
l.add(A);
}), l.size;
}
const s = t(this.absoluteDataset.filter((g) => !this.segregatedSeries.includes(g.id))), o = this.mutableConfig.useIndividualScale && this.FINAL_CONFIG.chart.grid.labels.show ? s * (this.mutableConfig.isStacked ? 0 : this.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth) : 0;
return {
top: this.FINAL_CONFIG.chart.padding.top,
right: this.width - this.FINAL_CONFIG.chart.padding.right,
bottom: this.height - this.FINAL_CONFIG.chart.padding.bottom,
left: this.FINAL_CONFIG.chart.padding.left + o,
height: this.height - (this.FINAL_CONFIG.chart.padding.top + this.FINAL_CONFIG.chart.padding.bottom),
width: this.width - (this.FINAL_CONFIG.chart.padding.right + this.FINAL_CONFIG.chart.padding.left + o)
};
},
max() {
return this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMax ? this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMax : Math.max(...this.safeDataset.filter((t) => !this.segregatedSeries.includes(t.id)).map((t) => Math.max(...t.series)));
},
min() {
if (this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMin !== null)
return this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMin;
const t = Math.min(...this.safeDataset.filter((s) => !this.segregatedSeries.includes(s.id)).map((s) => Math.min(...s.series)));
return t > 0 ? 0 : t;
},
niceScale() {
return this.calculateNiceScaleWithExactExtremes(this.min, this.max < 0 ? 0 : this.max, this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps);
},
maxSeries() {
return this.slicer.end - this.slicer.start;
},
timeLabels() {
const t = Math.max(...this.dataset.map((o) => this.largestTriangleThreeBucketsArray({ data: o.series, threshold: this.FINAL_CONFIG.downsample.threshold }).length)), s = [];
for (let o = 0; o < t; o += 1)
s.push({
text: this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[o] || String(o),
absoluteIndex: o
});
return s.slice(this.slicer.start, this.slicer.end);
},
slot() {
return {
bar: this.drawingArea.width / this.maxSeries / this.safeDataset.filter((t) => t.type === "bar").filter((t) => !this.segregatedSeries.includes(t.id)).length,
plot: this.drawingArea.width / this.maxSeries,
line: this.drawingArea.width / this.maxSeries
};
},
barSlot() {
const t = this.safeDataset.filter((s) => s.type === "bar").filter((s) => !this.segregatedSeries.includes(s.id)).length;
return this.drawingArea.width / this.maxSeries / t - this.barPeriodGap * t;
},
barPeriodGap() {
return this.slot.line * this.FINAL_CONFIG.bar.periodGap;
},
maxSlot() {
return Math.max(...Object.values(this.slot).filter((t) => t !== 1 / 0));
},
table() {
if (this.safeDataset.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
const t = this.relativeDataset.map((o) => ({
label: o.name,
color: o.color,
type: o.type
})), s = [];
return this.timeLabels.forEach((o, g) => {
const l = [o.text];
this.relativeDataset.forEach((e) => {
l.push(this.canShowValue(e.absoluteValues[g]) ? Number(e.absoluteValues[g].toFixed(this.FINAL_CONFIG.table.rounding)) : "");
}), s.push(l);
}), { head: t, body: s };
},
dataTable() {
const t = this.FINAL_CONFIG.table.showSum;
let s = [""].concat(this.relativeDataset.map((e) => e.name));
t && (s = s.concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>'));
let o = [];
for (let e = 0; e < this.maxSeries; e += 1) {
const A = this.relativeDataset.map((N) => N.absoluteValues[e] ?? 0).reduce((N, m) => N + m, 0);
o.push(
[
this.timeLabels[e].text ?? "-"
].concat(this.relativeDataset.map(
(N) => this.applyDataLabel(
N.type === "line" ? this.FINAL_CONFIG.line.labels.formatter : N.type === "bar" ? this.FINAL_CONFIG.bar.labels.formatter : this.FINAL_CONFIG.plot.labels.formatter,
N.absoluteValues[e] ?? 0,
this.dataLabel({
p: N.prefix || this.FINAL_CONFIG.chart.labels.prefix,
v: N.absoluteValues[e] ?? 0,
s: N.suffix || this.FINAL_CONFIG.chart.labels.suffix,
r: this.FINAL_CONFIG.table.rounding
})
)
)).concat(t ? (A ?? 0).toFixed(this.FINAL_CONFIG.table.rounding) : [])
);
}
const g = {
th: {
backgroundColor: this.FINAL_CONFIG.table.th.backgroundColor,
color: this.FINAL_CONFIG.table.th.color,
outline: this.FINAL_CONFIG.table.th.outline
},
td: {
backgroundColor: this.FINAL_CONFIG.table.td.backgroundColor,
color: this.FINAL_CONFIG.table.td.color,
outline: this.FINAL_CONFIG.table.td.outline
},
breakpoint: this.FINAL_CONFIG.table.responsiveBreakpoint
}, l = [this.FINAL_CONFIG.table.columnNames.period].concat(this.relativeDataset.map((e) => e.name)).concat(this.FINAL_CONFIG.table.columnNames.total);
return { head: s, body: o, config: g, colNames: l };
},
dataTooltipSlot() {
return {
datapoint: this.selectedSeries,
seriesIndex: this.selectedSerieIndex,
series: this.absoluteDataset,
bars: this.barSet,
lines: this.lineSet,
plots: this.plotSet,
config: this.FINAL_CONFIG
};
},
selectedSeries() {
return this.relativeDataset.map((t) => ({
slotAbsoluteIndex: t.slotAbsoluteIndex,
shape: t.shape || null,
name: t.name,
color: t.color,
type: t.type,
value: t.absoluteValues.find((s, o) => o === this.selectedSerieIndex),
comments: t.comments || [],
prefix: t.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: t.suffix || this.FINAL_CONFIG.chart.labels.suffix
}));
},
tooltipContent() {
let t = "", s = this.selectedSeries.map((l) => l.value).filter((l) => this.isSafeValue(l) && l !== null).reduce((l, e) => Math.abs(l) + Math.abs(e), 0);
const o = this.timeLabels[this.selectedSerieIndex], g = this.FINAL_CONFIG.chart.tooltip.customFormat;
return this.isFunction(g) && this.functionReturnsString(() => g({
seriesIndex: this.selectedSerieIndex,
datapoint: this.selectedSeries,
series: this.absoluteDataset,
bars: this.barSet,
lines: this.lineSet,
plots: this.plotSet,
config: this.FINAL_CONFIG
})) ? g({
seriesIndex: this.selectedSerieIndex,
datapoint: this.selectedSeries,
series: this.absoluteDataset,
bars: this.barSet,
lines: this.lineSet,
plots: this.plotSet,
config: this.FINAL_CONFIG
}) : (o && o.text && this.FINAL_CONFIG.chart.tooltip.showTimeLabel && (t += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${this.FINAL_CONFIG.chart.tooltip.borderColor}; width:100%">${o.text}</div>`), this.selectedSeries.forEach((l) => {
if (this.isSafeValue(l.value)) {
let e = "", A = "";
switch (this.icons[l.type]) {
case "bar":
e = `<svg viewBox="0 0 40 40" height="14" width="14">${this.$slots.pattern ? `<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${l.color}" />` : ""}<rect x="0" y="0" rx="1" stroke="none" height="40" width="40" fill="${this.$slots.pattern ? `url(#pattern_${this.uniqueId}_${l.slotAbsoluteIndex}` : l.color}" /></svg>`;
break;
case "line":
!l.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(l.shape) ? A = `<circle cx="10" cy="8" r="4" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${l.color}" />` : l.shape === "triangle" ? A = `<path d="${H({ plot: { x: 10, y: 8 }, radius: 4, sides: 3, rotation: 0.52 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : l.shape === "square" ? A = `<path d="${H({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0.8 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : l.shape === "diamond" ? A = `<path d="${H({ plot: { x: 10, y: 8 }, radius: 4, sides: 4, rotation: 0 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : l.shape === "pentagon" ? A = `<path d="${H({ plot: { x: 10, y: 8 }, radius: 4, sides: 5, rotation: 0.95 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : l.shape === "hexagon" ? A = `<path d="${H({ plot: { x: 10, y: 8 }, radius: 4, sides: 6, rotation: 0 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" />` : l.shape === "star" && (A = `<polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" fill="${l.color}" points="${q({ plot: { x: 10, y: 8 }, radius: 4 })}" />`), e = `<svg viewBox="0 0 20 12" height="14" width="20"><rect rx="1.5" x="0" y="6.5" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="0.5" height="3" width="20" fill="${l.color}" />${A}</svg>`;
break;
case "plot":
if (!l.shape || !["star", "triangle", "square", "diamond", "pentagon", "hexagon"].includes(l.shape)) {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" /></svg>`;
break;
}
if (l.shape === "star") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><polygon stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" fill="${l.color}" points="${q({ plot: { x: 6, y: 6 }, radius: 5 })}" /></svg>`;
break;
}
if (l.shape === "triangle") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${H({ plot: { x: 6, y: 6 }, radius: 6, sides: 3, rotation: 0.52 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
break;
}
if (l.shape === "square") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${H({ plot: { x: 6, y: 6 }, radius: 6, sides: 4, rotation: 0.8 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
break;
}
if (l.shape === "diamond") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${H({ plot: { x: 6, y: 6 }, radius: 5, sides: 4, rotation: 0 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
break;
}
if (l.shape === "pentagon") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${H({ plot: { x: 6, y: 6 }, radius: 5, sides: 5, rotation: 0.95 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
break;
}
if (l.shape === "hexagon") {
e = `<svg viewBox="0 0 12 12" height="14" width="14"><path d="${H({ plot: { x: 6, y: 6 }, radius: 5, sides: 6, rotation: 0 }).path}" fill="${l.color}" stroke="${this.FINAL_CONFIG.chart.tooltip.backgroundColor}" stroke-width="1" /></svg>`;
break;
}
}
t += `<div style="display:flex;flex-direction:row; align-items:center;gap:3px;"><div style="width:20px">${e}</div> ${l.name}: <b>${this.FINAL_CONFIG.chart.tooltip.showValue ? this.applyDataLabel(
l.type === "line" ? this.FINAL_CONFIG.line.labels.formatter : l.type === "bar" ? this.FINAL_CONFIG.bar.labels.formatter : this.FINAL_CONFIG.plot.labels.formatter,
l.value,
this.dataLabel({
p: l.prefix,
v: l.value,
s: l.suffix,
r: this.FINAL_CONFIG.chart.tooltip.roundingValue
}),
{ datapoint: l }
) : ""}</b> ${this.FINAL_CONFIG.chart.tooltip.showPercentage ? `(${U({
v: this.checkNaN(Math.abs(l.value) / s * 100),
s: "%",
r: this.FINAL_CONFIG.chart.tooltip.roundingPercentage
})})` : ""}</div>`, this.FINAL_CONFIG.chart.comments.showInTooltip && l.comments.length && l.comments.slice(this.slicer.start, this.slicer.end)[this.selectedSerieIndex] && (t += `<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${l.color}">${l.comments.slice(this.slicer.start, this.slicer.end)[this.selectedSerieIndex]}</div>`);
}
}), `<div style="border-radius:4px;padding:12px;font-variant-numeric: tabular-nums;color:${this.FINAL_CONFIG.chart.tooltip.color}">${t}</div>`);
},
svg() {
return {
height: this.height,
width: this.width
};
},
yLabels() {
return this.niceScale.ticks.map((t) => ({
y: t >= 0 ? this.zero - this.drawingArea.height * this.ratioToMax(t) : this.zero + this.drawingArea.height * this.ratioToMax(Math.abs(t)),
value: t,
prefix: this.FINAL_CONFIG.chart.labels.prefix,
suffix: this.FINAL_CONFIG.chart.labels.suffix
}));
},
zero() {
return this.drawingArea.bottom - this.drawingArea.height * this.ratioToMax(this.relativeZero);
}
},
mounted() {
this.svgRef = this.$refs.svgRef, this.prepareChart(), this.setupSlicer(), document.addEventListener("mousemove", (t) => {
this.clientPosition = {
x: t.clientX,
y: t.clientY
};
}), document.addEventListener("scroll", this.hideTags);
},
beforeUnmount() {
document.removeEventListener("scroll", this.hideTags);
},
methods: {
abbreviate: Se,
adaptColorToBackground: Ce,
applyDataLabel: Le,
assignStackRatios: Ae,
calcLinearProgression: ye,
calculateNiceScaleWithExactExtremes: _e,
checkNaN: Fe,
closestDecimal: be,
convertColorToHex: xe,
convertConfigColors: Ne,
convertCustomPalette: me,
createCsvContent: Ie,
createSmoothPath: fe,
createStraightPath: ge,
createTSpans: de,
dataLabel: U,
downloadCsv: ue,
error: he,
forceValidValue: oe,
functionReturnsString: ce,
hasDeepProperty: ne,
isFunction: se,
isSafeValue: ie,
largestTriangleThreeBucketsArray: re,
objectIsEmpty: ae,
setOpacity: le,
shiftHue: te,
translateSize: ee,
treeShake: $,
useMouse: ze,
useNestedProp: Z,
createUid: X,
placeXYTag: j,
hideTags() {
const t = document.querySelectorAll(".vue-ui-xy-tag");
t.length && Array.from(t).forEach((s) => s.style.opacity = "0");
},
setTagRef(t, s, o, g, l) {
o && (this.tagRefs[`${t}_${s}_${g}_${l}`] = o);
},
setUserOptionsVisibility(t = !1) {
this.showUserOptionsOnChartHover && (this.userOptionsVisible = t);
},
toggleAnnotator() {
this.isAnnotator = !this.isAnnotator;
},
selectTimeLabel(t, s) {
const o = this.relativeDataset.map((g) => ({
shape: g.shape || null,
name: g.name,
color: g.color,
type: g.type,
value: g.absoluteValues.find((l, e) => e === s),
comments: g.comments || [],
prefix: g.prefix || this.FINAL_CONFIG.chart.labels.prefix,
suffix: g.suffix || this.FINAL_CONFIG.chart.labels.suffix
}));
this.$emit("selectTimeLabel", {
datapoint: o,
absoluteIndex: t.absoluteIndex,
label: t.text
});
},
getHighlightAreaPosition(t) {
const s = this.drawingArea.left + this.drawingArea.width / this.maxSeries * (t.from - this.slicer.start), o = this.drawingArea.width / (this.slicer.end - this.slicer.start) * t.span < 0 ? 1e-5 : this.drawingArea.width / (this.slicer.end - this.slicer.start) * t.span;
return {
x: s < this.drawingArea.left ? this.drawingArea.left : s,
width: o
};
},
prepareConfig() {
const t = ke().vue_ui_xy;
if (!Object.keys(this.config || {}).length)
return t;
const s = this.useNestedProp({
userConfig: this.config,
defaultConfig: t
});
return this.config && this.hasDeepProperty(this.config, "chart.highlightArea") && (Array.isArray(this.config.chart.highlightArea) ? s.chart.highlightArea = this.config.chart.highlightArea : s.chart.highlightArea = [this.config.chart.highlightArea]), this.config && this.hasDeepProperty(this.config, "chart.grid.labels.yAxis.scaleMin") ? s.chart.grid.labels.yAxis.scaleMin = this.config.chart.grid.labels.yAxis.scaleMin : s.chart.grid.labels.yAxis.scaleMin = null, this.config && this.hasDeepProperty(this.config, "chart.grid.labels.yAxis.scaleMax") ? s.chart.grid.labels.yAxis.scaleMax = this.config.chart.grid.labels.yAxis.scaleMax : s.chart.grid.labels.yAxis.scaleMax = null, this.config && this.hasDeepProperty(this.config, "chart.zoom.startIndex") ? s.chart.zoom.startIndex = this.config.chart.zoom.startIndex : s.chart.zoom.startIndex = null, this.config && this.hasDeepProperty(this.config, "chart.zoom.endIndex") ? s.chart.zoom.endIndex = this.config.chart.zoom.endIndex : s.chart.zoom.endIndex = null, this.config && this.hasDeepProperty(this.config, "chart.grid.labels.yAxis.groupColor") ? s.chart.grid.labels.yAxis.groupColor = this.config.chart.grid.labels.yAxis.groupColor : s.chart.grid.labels.yAxis.groupColor = null, s.theme ? {
...Z({
userConfig: this.themes.vue_ui_xy[s.theme] || this.config,
defaultConfig: s
}),
customPalette: this.themePalettes[s.theme] || this.palette
} : s;
},
prepareChart() {
if (this.objectIsEmpty(this.dataset) ? this.error({
componentName: "VueUiXy",
type: "dataset"
}) : this.dataset.forEach((t, s) => {
[null, void 0].includes(t.name) && this.error({
componentName: "VueUiXy",
type: "datasetSerieAttribute",
property: "name (string)",
index: s
});
}), this.FINAL_CONFIG.showWarnings && this.dataset.forEach((t) => {
t.series.forEach((s, o) => {
this.isSafeValue(s) || console.warn(`VueUiXy has detected an unsafe value in your dataset:
-----> The serie '${t.name}' contains the value '${s}' at index ${o}.
'${s}' was converted to null to allow the chart to display.`);
});
}), this.showUserOptionsOnChartHover = this.FINAL_CONFIG.chart.userOptions.showOnChartHover, this.keepUserOptionState = this.FINAL_CONFIG.chart.userOptions.keepStateOnChartLeave, this.userOptionsVisible = !this.FINAL_CONFIG.chart.userOptions.showOnChartHover, this.mutableConfig = {
dataLabels: {
show: !0
},
showTooltip: this.FINAL_CONFIG.chart.tooltip.show === !0,
showTable: this.FINAL_CONFIG.showTable === !0,
isStacked: this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked,
useIndividualScale: this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale
}, this.FINAL_CONFIG.responsive) {
const s = this.$refs.chart.parentNode, { height: o, width: g } = s.getBoundingClientRect();
let l = null, e = 0;
this.FINAL_CONFIG.chart.title.show && (l = this.$refs.chartTitle, e = l.getBoundingClientRect().height);
let A = null, N = 0;
this.FINAL_CONFIG.chart.zoom.show && this.maxX > 6 && this.isDataset && (A = this.$refs.chartSlicer.$el, N = A.getBoundingClientRect().height);
let m = null, L = 0;
this.FINAL_CONFIG.chart.legend.show && (m = this.$refs.chartLegend, L = m.getBoundingClientRect().height);
let G = 0;
this.$refs.source && (G = this.$refs.source.getBoundingClientRect().height);
let w = 0;
this.$refs.noTitle && (w = this.$refs.noTitle.getBoundingClientRect().height), this.height = o - e - L - N - G - w, this.width = g, this.viewBox = `0 0 ${this.width < 0 ? 10 : this.width} ${this.height < 0 ? 10 : this.height}`, this.convertSizes(), new ResizeObserver((O) => {
for (const b of O)
this.$refs.chartTitle && (e = this.$refs.chartTitle.getBoundingClientRect().height), this.$refs.chartSlicer && this.$refs.chartSlicer.$el && (N = this.$refs.chartSlicer.$el.getBoundingClientRect().height), this.$refs.chartLegend && (L = this.$refs.chartLegend.getBoundingClientRect().height), this.$refs.source && (G = this.$refs.source.getBoundingClientRect().height), requestAnimationFrame(() => {
this.height = b.contentBoxSize[0].blockSize - e - L - N - G - 24, this.width = b.contentBoxSize[0].inlineSize, this.viewBox = `0 0 ${this.width < 0 ? 10 : this.width} ${this.height < 0 ? 10 : this.height}`, this.convertSizes();
});
}).observe(s);
} else
this.height = this.FINAL_CONFIG.chart.height, this.width = this.FINAL_CONFIG.chart.width, this.viewBox = `0 0 ${this.width} ${this.height}`, this.fontSizes.dataLabels = this.FINAL_CONFIG.chart.grid.labels.fontSize, this.fontSizes.yAxis = this.FINAL_CONFIG.chart.grid.labels.axis.fontSize, this.fontSizes.xAxis = this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.fontSize, this.fontSizes.plotLabels = this.FINAL_CONFIG.chart.labels.fontSize, this.plotRadii.plot = this.FINAL_CONFIG.plot.radius, this.plotRadii.line = this.FINAL_CONFIG.line.radius;
},
selectMinimapIndex(t) {
this.selectedMinimapIndex = t;
},
convertSizes() {
this.fontSizes.dataLabels = this.translateSize({
relator: this.height,
adjuster: 400,
source: this.FINAL_CONFIG.chart.grid.labels.fontSize,
threshold: 10,
fallback: 10
}), this.fontSizes.yAxis = this.translateSize({
relator: this.width,
adjuster: 1e3,
source: this.FINAL_CONFIG.chart.grid.labels.axis.fontSize,
threshold: 10,
fallback: 10
}), this.fontSizes.xAxis = this.translateSize({
relator: this.width,
adjuster: 1e3,
source: this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.fontSize,
threshold: 10,
fallback: 10
}), this.fontSizes.plotLabels = this.translateSize({
relator: this.width,
adjuster: 800,
source: this.FINAL_CONFIG.chart.labels.fontSize,
threshold: 10,
fallback: 10
}), this.plotRadii.plot = this.translateSize({
relator: this.width,
adjuster: 800,
source: this.FINAL_CONFIG.plot.radius,
threshold: 1,
fallback: 1
}), this.plotRadii.line = this.translateSize({
relator: this.width,
adjuster: 800,
source: this.FINAL_CONFIG.line.radius,
threshold: 1,
fallback: 1
});
},
toggleStack() {
this.mutableConfig.isStacked = !this.mutableConfig.isStacked, this.mutableConfig.isStacked ? this.mutableConfig.useIndividualScale = !0 : this.mutableConfig.useIndividualScale = this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale;
},
toggleTable() {
this.mutableConfig.showTable = !this.mutableConfig.showTable;
},
toggleLabels() {
this.mutableConfig.dataLabels.show = !this.mutableConfig.dataLabels.show;
},
toggleTooltip() {
this.mutableConfig.showTooltip = !this.mutableConfig.showTooltip;
},
checkAutoScaleError(t) {
t.autoScaling && (this.FINAL_CONFIG.chart.grid.labels.yAxis.useIndividualScale || console.warn(`VueUiXy (datapoint: ${t.name}) : autoScaling only works when config.chart.grid.labels.yAxis.useIndividualScale is set to true`), this.FINAL_CONFIG.chart.grid.labels.yAxis.stacked || console.warn(`VueUiXy (datapoint: ${t.name}) : autoScaling only works when config.chart.grid.labels.yAxis.stacked is set to true`));
},
createArea(t) {
if (!t[0]) return [-10, -10, "", -10, -10];
const s = { x: t[0].x, y: this.zero }, o = { x: t.at(-1).x, y: this.zero }, g = [];
return t.forEach((l) => {
g.push(`${l.x},${l.y} `);
}), [s.x, s.y, ...g, o.x, o.y].toString();
},
createIndividualArea(t, s) {
if (!t[0]) return [-10, -10, "", -10, -10];
const o = { x: t[0] ? t[0].x : Math.min(...t.filter((e) => !!e).map((e) => e.x)), y: s }, g = { x: t.at(-1) ? t.at(-1).x : Math.min(...t.filter((e) => !!e).map((e) => e.x)), y: s }, l = [];
return t.filter((e) => !!e).forEach((e) => {
l.push(`${e.x},${e.y} `);
}), [o.x, o.y, ...l, g.x, g.y].toString();
},
createStar: q,
createPolygonPath: H,
fillArray(t, s) {
let o = Array(t).fill(0);
for (let g = 0; g < s.length && g < t; g += 1)
o[g] = s[g];
return o;
},
async setupSlicer() {
(this.FINAL_CONFIG.chart.zoom.startIndex !== null || this.FINAL_CONFIG.chart.zoom.endIndex !== null) && this.$refs.chartSlicer ? (this.FINAL_CONFIG.chart.zoom.startIndex !== null && (await this.$nextTick(), await this.$nextTick(), this.$refs.chartSlicer.setStartValue(this.FINAL_CONFIG.chart.zoom.startIndex)), this.FINAL_CONFIG.chart.zoom.endIndex !== null && (await this.$nextTick(), await this.$nextTick(), this.$refs.chartSlicer.setEndValue(this.validSlicerEnd(this.FINAL_CONFIG.chart.zoom.endIndex + 1)))) : (this.slicer = {
start: 0,
end: Math.max(...this.dataset.map((t) => this.largestTriangleThreeBucketsArray({ data: t.series, threshold: this.FINAL_CONFIG.downsample.threshold }).length))
}, this.slicerStep += 1);
},
refreshSlicer() {
this.setupSlicer();
},
validSlicerEnd(t) {
const s = Math.max(...this.dataset.map((o) => this.largestTriangleThreeBucketsArray({ data: o.series, threshold: this.FINAL_CONFIG.downsample.threshold }).length));
return t > s ? s : t < 0 || this.FINAL_CONFIG.chart.zoom.startIndex !== null && t < this.FINAL_CONFIG.chart.zoom.startIndex ? this.FINAL_CONFIG.chart.zoom.startIndex !== null ? this.FINAL_CONFIG.chart.zoom.startIndex + 1 : 1 : t;
},
calcRectHeight(t) {
const s = ![null, void 0].includes(this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMin) && this.FINAL_CONFIG.chart.grid.labels.yAxis.scaleMin > 0 && this.min >= 0 ? this.drawingArea.bottom : this.zero;
return t.value >= 0 ? this.checkNaN(s - t.y <= 0 ? 1e-5 : s - t.y) : this.checkNaN(t.y - this.zero <= 0 ? 1e-5 : t.y - this.zero);
},
calcIndividualHeight(t) {
return t.value >= 0 ? this.checkNaN(t.zeroPosition - t.y <= 0 ? 1e-5 : t.zeroPosition - t.y) : this.checkNaN(t.y - t.zeroPosition <= 0 ? 1e-5 : t.zeroPosition - t.y);
},
calcRectWidth() {
return this.mutableConfig.useIndividualScale && this.mutableConfig.isStacked ? this.slot.line - this.drawingArea.width / this.maxSeries * 0.1 : this.slot.bar;
},
calcRectX(t) {
return this.mutableConfig.useIndividualScale && this.mutableConfig.isStacked ? t.x + this.drawingArea.width / this.maxSeries * 0.05 : t.x + this.slot.bar / 2;
},
calcRectY(t) {
return t.value >= 0 ? t.y : this.zero;
},
calcIndividualRectY(t) {
return t.value >= 0 ? t.y : [null, void 0, NaN, 1 / 0, -1 / 0].includes(t.zeroPosition) ? 0 : t.zeroPosition;
},
canShowValue(t) {
return ![null, void 0, NaN, 1 / 0, -1 / 0].includes(t);
},
findClosestValue(t, s) {
let o = s[0], g = Math.abs(t - s[0]);
for (let l = 1; l < s.length; l += 1) {
const e = Math.abs(t - s[l]);
e < g && s[l] < t && (o = s[l], g = e);
}
return o;
},
ratioToMax(t) {
return t / (this.canShowValue(this.absoluteMax) ? this.absoluteMax : 1);
},
selectX(t) {
this.$emit(
"selectX",
{
dataset: this.relativeDataset.map((s) => ({
name: s.name,
value: [null, void 0, NaN].includes(s.absoluteValues[t]) ? null : s.absoluteValues[t],
color: s.color,
type: s.type
})),
index: t,
indexLabel: this.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[t]
}
);
},
getData() {
return this.absoluteDataset.map((t) => ({
values: t.absoluteValues,
color: t.color,
name: t.name,
type: t.type
}));
},
segregate(t) {
if (this.segregatedSeries.includes(t.id))
this.segregatedSeries = this.segregatedSeries.filter((s) => s !== t.id);
else {
if (this.segregatedSeries.length + 1 === this.safeDataset.length) return;
this.segregatedSeries.push(t.id);
}
this.$emit("selectLegend", this.relativeDataset.map((s) => ({
name: s.name,
values: s.absoluteValues,
color: s.color,
type: s.type
}))), this.segregateStep += 1;
},
toggleTooltipVisibility(t, s = null) {
this.isTooltip = t, t ? this.selectedSerieIndex = s : this.selectedSerieIndex = null;
},
toggleFullscreen(t) {
this.isFullscreen = t, this.step += 1;
},
showSpinnerPdf() {
this.isPrinting = !0;
},
async generatePdf() {
this.showSpinnerPdf(), clearTimeout(this.__to__), this.isPrinting = !0, this.__to__ = setTimeout(async () => {
try {
const { default: t } = await import("./pdf-DVWl3Adn.js");
await t({
domElement: document.getElementById(`vue-ui-xy_${this.uniqueId}`),
fileName: this.FINAL_CONFIG.chart.title.text || "vue-ui-xy"
});
} catch (t) {
console.error("Error generating PDF:", t);
} finally {
this.isPrinting = !1;
}
}, 100);
},
generateCsv() {
const t = [[this.FINAL_CONFIG.chart.title.text], [this.FINAL_CONFIG.chart.title.subtitle.text], [""]], s = ["", ...this.table.head.map((e) => e.label)], o = this.table.body, g = t.concat([s]).concat(o), l = this.createCsvContent(g);
this.downloadCsv({ csvContent: l, title: this.FINAL_CONFIG.chart.title.text || "vue-ui-xy" });
},
showSpinnerImage() {
this.isImaging = !0;
},
async generateImage() {
this.showSpinnerImage(), clearTimeout(this.__to__), this.isImaging = !0, this.__to__ = setTimeout(async () => {
try {
const { default: t } = await import("./img-itj0Vdmx.js");
await t({
domElement: document.getElementById(`vue-ui-xy_${this.uniqueId}`),
fileName: this.FINAL_CONFIG.chart.title.text || "vue-ui-xy",
format: "png"
});
} catch (t) {
console.error("Error generating image:", t);
} finally {
this.isImaging = !1;
}
}, 100);
}
}
}, Qe = ["id"], je = {
key: 1,
ref: "noTitle",
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%; background:transparent"
}, $e = ["viewBox", "aria-label"], et = ["x", "y", "width", "height"], tt = { key: 1 }, lt = { class: "vue-ui-xy-grid" }, at = ["stroke", "x1", "x2", "y1", "y2"], rt = ["stroke", "x1", "x2", "y1", "y2"], it = { key: 1 }, st = ["x1", "x2", "y1", "y2", "stroke"], nt = ["x1", "x2", "y1", "y2", "stroke"], ct = ["x1", "x2", "y1", "y2", "stroke"], ot = { key: 3 }, ht = ["x1", "x2", "y1", "y2", "stroke"], ut = ["id"], dt = ["stop-color"], gt = ["stop-color"], ft = ["stop-color"], It = ["id"], mt = ["stop-color"], Nt = ["stop-color"], xt = ["stop-color"], bt = ["id"], Ft = ["stop-color"], _t = ["stop-color"], yt = ["id"], At = ["stop-color"], Lt = ["stop-color"], Ct = ["id"], St = ["stop-color"], kt = ["stop-color"], wt = ["x", "y", "height", "width", "fill"], Ot = ["x", "y", "width"], Gt = ["x", "y", "height", "width", "fill"], vt = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], pt = ["x", "y", "height", "width", "rx", "fill", "stroke", "stroke-width"], Mt = ["width", "x", "y"], zt = { key: 0 }, Tt = ["id"], Pt = ["fill"], Vt = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], Rt = ["x", "y", "font-size", "fill"], Ht = ["stroke", "x1", "x2", "y1", "y2"], Dt = { key: 2 }, Bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Et = ["x", "y", "width", "height", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-dasharray"], Wt = { key: 4 }, Yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], qt = ["fill", "font-size", "transform"], Xt = ["x1", "x2", "y1", "y2", "stroke"], Ut = ["x", "y", "font-size", "fill"], Zt = ["x1", "x2", "y1", "y2", "stroke"], Jt = ["x", "y", "font-size", "fill"], Kt = ["width", "x", "y"], Qt = { style: { width: "100%" } }, jt = { key: 0 }, $t = ["id"], el = ["fill"], tl = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], ll = ["x", "y", "font-size", "fill"], al = ["d", "stroke", "stroke-width", "stroke-dasharray"], rl = ["d", "stroke", "stroke-width", "stroke-dasharray"], il = { key: 5 }, sl = { key: 0 }, nl = ["d", "fill"], cl = ["d", "fill"], ol = ["d", "fill"], hl = ["d", "fill"], ul = ["d", "stroke", "stroke-width", "stroke-dasharray"], dl = ["d", "stroke", "stroke-width", "stroke-dasharray"], gl = ["width", "x", "y"], fl = { style: { width: "100%" } }, Il = { key: 3 }, ml = ["id"], Nl = ["fill"], xl = ["x1", "x2", "y1", "y2", "stroke", "marker-end"], bl = ["x", "y", "font-size", "fill"], Fl = { key: 6 }, _l = ["x", "y", "font-size", "fill"], yl = ["x", "y", "font-size", "fill", "font-weight"], Al = { key: 7 }, Ll = ["x", "y", "font-size", "fill"], Cl = { key: 8 }, Sl = ["x", "y"], kl = ["innerHTML"], wl = ["x", "y"], Ol = ["innerHTML"], Gl = ["x1", "x2", "y1", "y2", "stroke"], vl = { key: 9 }, pl = ["x", "y", "font-size", "fill"], Ml = { key: 10 }, zl = ["x", "y"], Tl = ["innerHTML"], Pl = ["x", "y"], Vl = ["innerHTML"], Rl = ["x1", "x2", "y1", "y2", "stroke"], Hl = ["x", "y", "font-size", "fill", "innerHTML"], Dl = ["x", "y", "font-size", "fill", "innerHTML"], Bl = ["x", "y", "font-size", "fill", "innerHTML"], El = ["x", "y", "font-size", "fill", "innerHTML"], Wl = ["id"], Yl = ["stop-color"], ql = ["stop-color"], Xl = ["x", "y", "width", "height", "fill", "onMouseenter"], Ul = ["font-size", "fill", "transform"], Zl = ["x", "y", "font-size", "fill"], Jl = { key: 12 }, Kl = ["text-anchor", "font-size", "fill", "transform", "onClick"], Ql = ["x", "y", "height", "width", "onMouseenter", "onClick"], jl = {
key: 13,
style: { "pointer-events": "none" }
}, $l = ["x", "y"], ea = ["cx", "cy", "r", "fill"], ta = {
key: 5,
class: "vue-data-ui-watermark"
}, la = {
class: "vue-ui-xy-tag-arrow",
height: "20",
viewBox: "0 0 10 20",
style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
}, aa = ["fill"], ra = ["innerHTML"], ia = {
class: "vue-ui-xy-tag-arrow",
height: "100%",
viewBox: "0 0 10 20",
style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
}, sa = ["fill"], na = ["innerHTML"], ca = {
class: "vue-ui-xy-tag-arrow",
height: "20",
viewBox: "0 0 10 20",
style: { position: "absolute", right: "100%", top: "50%", transform: "translateY(-50%)" }
}, oa = ["fill"], ha = ["innerHTML"], ua = {
class: "vue-ui-xy-tag-arrow",
height: "100%",
viewBox: "0 0 10 20",
style: { position: "absolute", left: "100%", top: "50%", transform: "translateY(-50%)" }
}, da = ["fill"], ga = ["innerHTML"], fa = ["onClick"], Ia = {
key: 0,
viewBox: "0 0 20 12",
height: "14",
width: "20"
}, ma = ["stroke", "fill"], Na = {
key: 1,
viewBox: "0 0 40 40",
height: "14",
width: "14"
}, xa = ["fill"], ba = ["fill"], Fa = {
key: 2,
viewBox: "0 0 12 12",
height: "14",
width: "14"
}, _a = {
key: 9,
ref: "chartLegend"
}, ya = {
key: 10,
ref: "source",
dir: "auto"
}, Aa = {
style: { display: "flex", "flex-direction": "row", gap: "6px", "align-items": "center", "padding-left": "6px" },
"data-html2canvas-ignore": ""
}, La = ["innerHTML"];
function Ca(t, s, o, g, l, e) {
const A = R("PenAndPaper"), N = R("Title"), m = R("UserOptions"), L = R("PackageVersion"), G = R("Shape"), w = R("Skeleton"), v = R("Slicer"), O = R("Tooltip"), b = R("BaseIcon"), C = R("TableSparkline"), p = R("DataTable"), V = R("Accordion");
return r(), i("div", {
id: `vue-ui-xy_${l.uniqueId}`,
class: B(`vue-ui-xy ${l.isFullscreen ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.FINAL_CONFIG.useCssAnimation ? "" : "vue-ui-dna"}`),
ref: "chart",
style: x(`background:${e.FINAL_CONFIG.chart.backgroundColor}; color:${e.FINAL_CONFIG.chart.color};width:100%;font-family:${e.FINAL_CONFIG.chart.fontFamily};${e.FINAL_CONFIG.responsive ? "height: 100%" : ""}`),
onMouseenter: s[7] || (s[7] = () => e.setUserOptionsVisibility(!0)),
onMouseleave: s[8] || (s[8] = () => e.setUserOptionsVisibility(!1))
}, [
e.FINAL_CONFIG.chart.userOptions.buttons.annotator ? (r(), D(A, {
key: 0,
svgRef: l.svgRef,
backgroundColor: e.FINAL_CONFIG.chart.backgroundColor,
color: e.FINAL_CONFIG.chart.color,
active: l.isAnnotator,
onClose: e.toggleAnnotator
}, null, 8, ["svgRef", "backgroundColor", "color", "active", "onClose"])) : u("", !0),
e.hasOptionsNoTitle ? (r(), i("div", je, null, 512)) : u("", !0),
e.FINAL_CONFIG.chart.title.show ? (r(), i("div", {
key: 2,
ref: "chartTitle",
class: "vue-ui-xy-title",
style: x(`font-family:${e.FINAL_CONFIG.chart.fontFamily}`)
}, [
(r(), D(N, {
key: `title_${l.titleStep}`,
config: {
title: {
cy: "xy-div-title",
...e.FINAL_CONFIG.chart.title
},
subtitle: {
cy: "xy-div-subtitle",
...e.FINAL_CONFIG.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 4)) : u("", !0),
e.FINAL_CONFIG.chart.userOptions.show && e.isDataset && (l.keepUserOptionState || l.userOptionsVisible) ? (r(), D(m, {
ref: "defails",
key: `user_options_${l.step}`,
backgroundColor: e.FINAL_CONFIG.chart.backgroundColor,
color: e.FINAL_CONFIG.chart.color,
isPrinting: l.isPrinting,
isImaging: l.isImaging,
uid: l.uniqueId,
hasTooltip: e.FINAL_CONFIG.chart.userOptions.buttons.tooltip && e.FINAL_CONFIG.chart.tooltip.show,
hasPdf: e.FINAL_CONFIG.chart.userOptions.buttons.pdf,
hasXls: e.FINAL_CONFIG.chart.userOptions.buttons.csv,
hasImg: e.FINAL_CONFIG.chart.userOptions.buttons.img,
hasLabel: e.FINAL_CONFIG.chart.userOptions.buttons.labels,
hasTable: e.FINAL_CONFIG.chart.userOptions.buttons.table,
hasStack: o.dataset.length > 1 && e.FINAL_CONFIG.chart.userOptions.buttons.stack,
hasFullscreen: e.FINAL_CONFIG.chart.userOptions.buttons.fullscreen,
isStacked: l.mutableConfig.isStacked,
isFullscreen: l.isFullscreen,
chartElement: t.$refs.chart,
position: e.FINAL_CONFIG.chart.userOptions.position,
isTooltip: l.mutableConfig.showTooltip,
titles: { ...e.FINAL_CONFIG.chart.userOptions.buttonTitles },
hasAnnotator: e.FINAL_CONFIG.chart.userOptions.buttons.annotator,
isAnnotation: l.isAnnotator,
onToggleFullscreen: e.toggleFullscreen,
onGeneratePdf: e.generatePdf,
onGenerateCsv: e.generateCsv,
onGenerateImage: e.generateImage,
onToggleTable: e.toggleTable,
onToggleLabels: e.toggleLabels,
onToggleStack: e.toggleStack,
onToggleTooltip: e.toggleTooltip,
onToggleAnnotator: e.toggleAnnotator,
style: x({
visibility: l.keepUserOptionState ? l.userOptionsVisible ? "visible" : "hidden" : "visible"
})
}, qe({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: P(({ isOpen: a, color: c }) => [
S(t.$slots, "menuIcon", E(W({ isOpen: a, color: c })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: P(() => [
S(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: P(() => [
S(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: P(() => [
S(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: P(() => [
S(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: P(() => [
S(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionLabels ? {
name: "optionLabels",
fn: P(() => [
S(t.$slots, "optionLabels", {}, void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionStack ? {
name: "optionStack",
fn: P(() => [
S(t.$slots, "optionStack", {}, void 0, !0)
]),
key: "7"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: P(({ toggleFullscreen: a, isFullscreen: c }) => [
S(t.$slots, "optionFullscreen", E(W({ toggleFullscreen: a, isFullscreen: c })), void 0, !0)
]),
key: "8"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: P(({ toggleAnnotator: a, isAnnotator: c }) => [
S(t.$slots, "optionAnnotator", E(W({ toggleAnnotator: a, isAnnotator: c })), void 0, !0)
]),
key: "9"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasLabel", "hasTable", "hasStack", "hasFullscreen", "isStacked", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onToggleFullscreen", "onGeneratePdf", "onGenerateCsv", "onGenerateImage", "onToggleTable", "onToggleLabels", "onToggleStack", "onToggleTooltip", "onToggleAnnotator", "style"])) : u("", !0),
e.isDataset ? (r(), i("svg", {
key: 4,
ref: "svgRef",
xmlns: "http://www.w3.org/2000/svg",
class: B([{ "vue-data-ui-fullscreen--on": l.isFullscreen, "vue-data-ui-fulscreen--off": !l.isFullscreen }, "vue-ui-xy-svg"]),
width: "100%",
viewBox: l.viewBox,
style: x(`background: transparent; color:${e.FINAL_CONFIG.chart.color}; font-family:${e.FINAL_CONFIG.chart.fontFamily}`),
"aria-label": e.chartAriaLabel,
role: "img",
"aria-live": "polite"
}, [
Y(L),
t.$slots["chart-background"] ? (r(), i("foreignObject", {
key: 0,
x: e.drawingArea.left + e.xPadding < 0 ? 0 : e.drawingArea.left + e.xPadding,
y: e.drawingArea.top,
width: e.drawingArea.width - (e.FINAL_CONFIG.chart.grid.position === "middle" ? 0 : e.drawingArea.width / e.maxSeries) < 0 ? 0 : e.drawingArea.width - (e.FINAL_CONFIG.chart.grid.position === "middle" ? 0 : e.drawingArea.width / e.maxSeries),
height: e.drawingArea.height < 0 ? 0 : e.drawingArea.height,
style: {
pointerEvents: "none"
}
}, [
S(t.$slots, "chart-background", {}, void 0, !0)
], 8, et)) : u("", !0),
e.maxSeries > 0 ? (r(), i("g", tt, [
f("g", lt, [
e.FINAL_CONFIG.chart.grid.labels.xAxis.showBaseline ? (r(), i("line", {
key: 0,
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": "1",
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.right - e.xPadding,
y1: e.forceValidValue(e.drawingArea.bottom),
y2: e.forceValidValue(e.drawingArea.bottom),
"stroke-linecap": "round"
}, null, 8, at)) : u("", !0),
l.mutableConfig.useIndividualScale ? e.FINAL_CONFIG.chart.grid.showHorizontalLines ? (r(!0), i(d, { key: 2 }, I(e.allScales, (a) => (r(), i("g", null, [
a.id === l.selectedScale && a.yLabels.length ? (r(!0), i(d, { key: 0 }, I(a.yLabels, (c) => (r(), i("line", {
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.right - e.xPadding,
y1: e.forceValidValue(c.y),
y2: e.forceValidValue(c.y),
stroke: a.color,
"stroke-width": 0.5,
"stroke-linecap": "round"
}, null, 8, nt))), 256)) : a.yLabels.length ? (r(!0), i(d, { key: 1 }, I(a.yLabels, (c) => (r(), i("line", {
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.right - e.xPadding,
y1: e.forceValidValue(c.y),
y2: e.forceValidValue(c.y),
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": 0.5,
"stroke-linecap": "round"
}, null, 8, ct))), 256)) : u("", !0)
]))), 256)) : u("", !0) : (r(), i(d, { key: 1 }, [
e.FINAL_CONFIG.chart.grid.labels.yAxis.showBaseline ? (r(), i("line", {
key: 0,
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": "1",
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.left + e.xPadding,
y1: e.forceValidValue(e.drawingArea.top),
y2: e.forceValidValue(e.drawingArea.bottom),
"stroke-linecap": "round"
}, null, 8, rt)) : u("", !0),
e.FINAL_CONFIG.chart.grid.showHorizontalLines ? (r(), i("g", it, [
(r(!0), i(d, null, I(e.yLabels, (a) => (r(), i("line", {
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.right - e.xPadding,
y1: e.forceValidValue(a.y),
y2: e.forceValidValue(a.y),
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": 0.5,
"stroke-linecap": "round"
}, null, 8, st))), 256))
])) : u("", !0)
], 64)),
e.FINAL_CONFIG.chart.grid.showVerticalLines ? (r(), i("g", ot, [
(r(!0), i(d, null, I(e.maxSeries + (e.FINAL_CONFIG.chart.grid.position === "middle" ? 1 : 0), (a, c) => (r(), i("line", {
key: `grid_vertical_line_${c}`,
x1: e.drawingArea.width / e.maxSeries * c + e.drawingArea.left + e.xPadding,
x2: e.drawingArea.width / e.maxSeries * c + e.drawingArea.left + e.xPadding,
y1: e.forceValidValue(e.drawingArea.top),
y2: e.forceValidValue(e.drawingArea.bottom),
"stroke-width": "0.5",
stroke: e.FINAL_CONFIG.chart.grid.stroke
}, null, 8, ht))), 128))
])) : u("", !0)
]),
(r(!0), i(d, null, I(e.barSet, (a, c) => (r(), i("defs", {
key: `def_rect_${c}`
}, [
f("linearGradient", {
id: `rectGradient_pos_${c}_${l.uniqueId}`,
x2: "0%",
y2: "100%"
}, [
f("stop", {
offset: "0%",
"stop-color": a.color
}, null, 8, dt),
f("stop", {
offset: "62%",
"stop-color": `${e.shiftHue(a.color, 0.02)}`
}, null, 8, gt),
f("stop", {
offset: "100%",
"stop-color": `${e.shiftHue(a.color, 0.05)}`
}, null, 8, ft)
], 8, ut),
f("linearGradient", {
id: `rectGradient_neg_${c}_${l.uniqueId}`,
x2: "0%",
y2: "100%"
}, [
f("stop", {
offset: "0%",
"stop-color": `${e.shiftHue(a.color, 0.05)}`
}, null, 8, mt),
f("stop", {
offset: "38%",
"stop-color": `${e.shiftHue(a.color, 0.02)}`
}, null, 8, Nt),
f("stop", {
offset: "100%",
"stop-color": a.color
}, null, 8, xt)
], 8, It)
]))), 128)),
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i("defs", {
key: `def_plot_${c}`
}, [
f("radialGradient", {
id: `plotGradient_${c}_${l.uniqueId}`,
cx: "50%",
cy: "50%",
r: "50%",
fx: "50%",
fy: "50%"
}, [
f("stop", {
offset: "0%",
"stop-color": `${e.shiftHue(a.color, 0.05)}`
}, null, 8, Ft),
f("stop", {
offset: "100%",
"stop-color": a.color
}, null, 8, _t)
], 8, bt)
]))), 128)),
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i("defs", {
key: `def_line_${c}`
}, [
f("radialGradient", {
id: `lineGradient_${c}_${l.uniqueId}`,
cx: "50%",
cy: "50%",
r: "50%",
fx: "50%",
fy: "50%"
}, [
f("stop", {
offset: "0%",
"stop-color": `${e.shiftHue(a.color, 0.05)}`
}, null, 8, At),
f("stop", {
offset: "100%",
"stop-color": a.color
}, null, 8, Lt)
], 8, yt),
f("linearGradient", {
id: `areaGradient_${c}_${l.uniqueId}`,
x1: "0%",
x2: "100%",
y1: "0%",
y2: "0%"
}, [
f("stop", {
offset: "0%",
"stop-color": `${e.setOpacity(e.shiftHue(a.color, 0.03), e.FINAL_CONFIG.line.area.opacity)}`
}, null, 8, St),
f("stop", {
offset: "100%",
"stop-color": `${e.setOpacity(a.color, e.FINAL_CONFIG.line.area.opacity)}`
}, null, 8, kt)
], 8, Ct)
]))), 128)),
(r(!0), i(d, null, I(e.highlightAreas, (a) => (r(), i("g", null, [
a.show ? (r(!0), i(d, { key: 0 }, I(a.span, (c, n) => (r(), i("g", null, [
f("rect", {
style: x({
transition: "none",
opacity: a.from + n >= l.slicer.start && a.from + n <= l.slicer.end - 1 ? 1 : 0
}),
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * (a.from + n - l.slicer.start),
y: e.drawingArea.top,
height: e.drawingArea.height < 0 ? 10 : e.drawingArea.height,
width: e.drawingArea.width / e.maxSeries < 0 ? 1e-5 : e.drawingArea.width / e.maxSeries,
fill: e.setOpacity(a.color, a.opacity)
}, null, 12, wt),
a.caption.text && n === 0 ? (r(), i("foreignObject", {
key: 0,
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * (a.from + n - l.slicer.start) - (a.caption.width === "auto" ? 0 : a.caption.width / 2 - e.drawingArea.width / e.maxSeries * a.span / 2),
y: e.drawingArea.top + a.caption.offsetY,
style: x({
overflow: "visible",
opacity: a.to >= l.slicer.start && a.from < l.slicer.end ? 1 : 0
}),
height: "1",
width: a.caption.width === "auto" ? e.drawingArea.width / e.maxSeries * a.span : a.caption.width
}, [
f("div", {
style: x(`padding:${a.caption.padding}px;text-align:${a.caption.textAlign};font-size:${a.caption.fontSize}px;color:${a.caption.color};font-weight:${a.caption.bold ? "bold" : "normal"}`)
}, T(a.caption.text), 5)
], 12, Ot)) : u("", !0)
]))), 256)) : u("", !0)
]))), 256)),
f("g", null, [
(r(!0), i(d, null, I(e.maxSeries, (a, c) => (r(), i("g", {
key: `tooltip_trap_highlighter_${c}`
}, [
f("rect", {
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * c,
y: e.drawingArea.top,
height: e.drawingArea.height < 0 ? 10 : e.drawingArea.height,
width: e.drawingArea.width / e.maxSeries < 0 ? 1e-5 : e.drawingArea.width / e.maxSeries,
fill: [l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(c) ? e.setOpacity(e.FINAL_CONFIG.chart.highlighter.color, e.FINAL_CONFIG.chart.highlighter.opacity) : "transparent"
}, null, 8, Gt)
]))), 128))
]),
e.barSet.length ? (r(!0), i(d, { key: 0 }, I(e.barSet, (a, c) => (r(), i("g", {
key: `serie_bar_${c}`,
class: B(`serie_bar_${c}`),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i("g", {
key: `bar_plot_${c}_${h}`
}, [
e.canShowValue(n.value) ? (r(), i("rect", {
key: 0,
x: e.calcRectX(n),
y: l.mutableConfig.useIndividualScale ? e.calcIndividualRectY(n) : e.calcRectY(n),
height: l.mutableConfig.useIndividualScale ? Math.abs(e.calcIndividualHeight(n)) : Math.abs(e.calcRectHeight(n)),
width: e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap) < 0 ? 1e-5 : e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap),
rx: e.FINAL_CONFIG.bar.borderRadius,
fill: e.FINAL_CONFIG.bar.useGradient ? n.value >= 0 ? `url(#rectGradient_pos_${c}_${l.uniqueId})` : `url(#rectGradient_neg_${c}_${l.uniqueId})` : a.color,
stroke: e.FINAL_CONFIG.bar.border.useSerieColor ? a.color : e.FINAL_CONFIG.bar.border.stroke,
"stroke-width": e.FINAL_CONFIG.bar.border.strokeWidth
}, null, 8, vt)) : u("", !0),
e.canShowValue(n.value) && t.$slots.pattern ? (r(), i("rect", {
key: 1,
x: e.calcRectX(n),
y: l.mutableConfig.useIndividualScale ? e.calcIndividualRectY(n) : e.calcRectY(n),
height: l.mutableConfig.useIndividualScale ? Math.abs(e.calcIndividualHeight(n)) : Math.abs(e.calcRectHeight(n)),
width: e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap) < 0 ? 1e-5 : e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap),
rx: e.FINAL_CONFIG.bar.borderRadius,
fill: `url(#pattern_${l.uniqueId}_${a.slotAbsoluteIndex})`,
stroke: e.FINAL_CONFIG.bar.border.useSerieColor ? a.color : e.FINAL_CONFIG.bar.border.stroke,
"stroke-width": e.FINAL_CONFIG.bar.border.strokeWidth
}, null, 8, pt)) : u("", !0),
n.comment && e.FINAL_CONFIG.chart.comments.show ? (r(), i("foreignObject", {
key: 2,
style: { overflow: "visible" },
height: "12",
width: (e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap) < 0 ? 1e-5 : e.calcRectWidth() - (l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? 0 : e.barPeriodGap) / 2) + e.FINAL_CONFIG.chart.comments.width,
x: e.calcRectX(n) - e.FINAL_CONFIG.chart.comments.width / 2 + e.FINAL_CONFIG.chart.comments.offsetX,
y: e.checkNaN(n.y) + e.FINAL_CONFIG.chart.comments.offsetY + 6
}, [
S(t.$slots, "plot-comment", {
plot: { ...n, color: a.color, seriesIndex: c, datapointIndex: h }
}, void 0, !0)
], 8, Mt)) : u("", !0)
]))), 128)),
Object.hasOwn(a, "useProgression") && a.useProgression === !0 && !isNaN(e.calcLinearProgression(a.plots).trend) ? (r(), i("g", zt, [
f("defs", null, [
f("marker", {
id: `bar_arrow_${c}`,
markerWidth: 7,
markerHeight: 7,
refX: "0",
refY: 7 / 2,
orient: "auto"
}, [
f("polygon", {
points: `0 0, 7 ${7 / 2}, 0 7`,
fill: a.color
}, null, 8, Pt)
], 8, Tt)
]),
a.plots.length > 1 ? (r(), i("line", {
key: 0,
x1: e.calcLinearProgression(a.plots).x1,
x2: e.calcLinearProgression(a.plots).x2,
y1: e.forceValidValue(e.calcLinearProgression(a.plots).y1),
y2: e.forceValidValue(e.calcLinearProgression(a.plots).y2),
"stroke-width": 1,
stroke: a.color,
"stroke-dasharray": 2,
"marker-end": `url(#bar_arrow_${c})`
}, null, 8, Vt)) : u("", !0),
a.plots.length > 1 ? (r(), i("text", {
key: 1,
"text-anchor": "middle",
x: e.calcLinearProgression(a.plots).x2,
y: e.calcLinearProgression(a.plots).y2 - 6,
"font-size": l.fontSizes.plotLabels,
fill: a.color
}, T(e.dataLabel({
v: e.calcLinearProgression(a.plots).trend * 100,
s: "%",
r: 2
})), 9, Rt)) : u("", !0)
])) : u("", !0)
], 6))), 128)) : u("", !0),
!l.mutableConfig.useIndividualScale && e.FINAL_CONFIG.chart.grid.labels.zeroLine.show ? (r(), i("line", {
key: 1,
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": "1",
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.right - e.xPadding,
y1: e.forceValidValue(e.zero),
y2: e.forceValidValue(e.zero),
"stroke-linecap": "round"
}, null, 8, Ht)) : u("", !0),
e.FINAL_CONFIG.chart.highlighter.useLine && (![null, void 0].includes(l.selectedSerieIndex) || ![null, void 0].includes(l.selectedMinimapIndex)) ? (r(), i("g", Dt, [
f("line", {
x1: e.drawingArea.left + e.drawingArea.width / e.maxSeries * ((l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)) + e.drawingArea.width / e.maxSeries / 2,
x2: e.drawingArea.left + e.drawingArea.width / e.maxSeries * ((l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)) + e.drawingArea.width / e.maxSeries / 2,
y1: e.forceValidValue(e.drawingArea.top),
y2: e.forceValidValue(e.drawingArea.bottom),
stroke: e.FINAL_CONFIG.chart.highlighter.color,
"stroke-width": e.FINAL_CONFIG.chart.highlighter.lineWidth,
"stroke-dasharray": e.FINAL_CONFIG.chart.highlighter.lineDasharray,
"stroke-linecap": "round",
style: { transition: "none !important", animation: "none !important", "pointer-events": "none" }
}, null, 8, Bt)
])) : u("", !0),
e.FINAL_CONFIG.chart.grid.frame.show ? (r(), i("rect", {
key: 3,
style: { pointerEvents: "none", transition: "none" },
x: e.drawingArea.left + e.xPadding < 0 ? 0 : e.drawingArea.left + e.xPadding,
y: e.drawingArea.top,
width: e.drawingArea.width - (e.FINAL_CONFIG.chart.grid.position === "middle" ? 0 : e.drawingArea.width / e.maxSeries) < 0 ? 0 : e.drawingArea.width - (e.FINAL_CONFIG.chart.grid.position === "middle" ? 0 : e.drawingArea.width / e.maxSeries),
height: e.drawingArea.height < 0 ? 0 : e.drawingArea.height,
fill: "transparent",
stroke: e.FINAL_CONFIG.chart.grid.frame.stroke,
"stroke-width": e.FINAL_CONFIG.chart.grid.frame.strokeWidth,
"stroke-linecap": e.FINAL_CONFIG.chart.grid.frame.strokeLinecap,
"stroke-linejoin": e.FINAL_CONFIG.chart.grid.frame.strokeLinejoin,
"stroke-dasharray": e.FINAL_CONFIG.chart.grid.frame.strokeDasharray
}, null, 8, Et)) : u("", !0),
e.FINAL_CONFIG.chart.grid.labels.show ? (r(), i("g", Wt, [
l.mutableConfig.useIndividualScale ? (r(), i(d, { key: 0 }, [
(r(!0), i(d, null, I(e.allScales, (a) => (r(), i("g", null, [
f("line", {
x1: a.x + e.xPadding,
x2: a.x + e.xPadding,
y1: l.mutableConfig.isStacked ? e.forceValidValue(e.drawingArea.bottom - a.yOffset - a.individualHeight) : e.forceValidValue(e.drawingArea.top),
y2: l.mutableConfig.isStacked ? e.forceValidValue(e.drawingArea.bottom - a.yOffset) : e.forceValidValue(e.drawingArea.bottom),
stroke: a.color,
"stroke-width": e.FINAL_CONFIG.chart.grid.stroke,
"stroke-linecap": "round",
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out`)
}, null, 12, Yt)
]))), 256)),
(r(!0), i(d, null, I(e.allScales, (a) => (r(), i("g", {
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.3 : 1};transition:opacity 0.2s ease-in-out`)
}, [
f("text", {
fill: a.color,
"font-size": l.fontSizes.dataLabels,
"text-anchor": "middle",
transform: `translate(${a.x - e.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth + 5 + e.xPadding + e.FINAL_CONFIG.chart.grid.labels.yAxis.scaleLabelOffsetX}, ${l.mutableConfig.isStacked ? e.drawingArea.bottom - a.yOffset - a.individualHeight / 2 : e.drawingArea.top + e.drawingArea.height / 2}) rotate(-90)`
}, T(a.name) + " " + T(a.scaleLabel && a.unique && a.scaleLabel !== a.id ? `- ${a.scaleLabel}` : ""), 9, qt),
(r(!0), i(d, null, I(a.yLabels, (c, n) => (r(), i("line", {
x1: a.x - 3 + e.xPadding,
x2: a.x + e.xPadding,
y1: e.forceValidValue(c.y),
y2: e.forceValidValue(c.y),
stroke: a.color,
"stroke-width": 1,
"stroke-linecap": "round"
}, null, 8, Xt))), 256)),
(r(!0), i(d, null, I(a.yLabels, (c, n) => (r(), i("text", {
x: a.x - 5 + e.xPadding + e.FINAL_CONFIG.chart.grid.labels.yAxis.scaleValueOffsetX,
y: e.forceValidValue(c.y) + l.fontSizes.dataLabels / 3,
"font-size": l.fontSizes.dataLabels,
"text-anchor": "end",
fill: a.color
}, T(e.applyDataLabel(
e.FINAL_CONFIG.chart.grid.labels.yAxis.formatter,
c.value,
e.dataLabel({
p: c.prefix,
v: c.value,
s: c.suffix,
r: 1
}),
{ datapoint: c.datapoint, seriesIndex: n }
)), 9, Ut))), 256))
], 4))), 256))
], 64)) : (r(!0), i(d, { key: 1 }, I(e.yLabels, (a, c) => (r(), i("g", {
key: `yLabel_${c}`
}, [
e.canShowValue(a) && a.value >= e.niceScale.min && a.value <= e.niceScale.max ? (r(), i("line", {
key: 0,
x1: e.drawingArea.left + e.xPadding,
x2: e.drawingArea.left - 5 + e.xPadding,
y1: e.forceValidValue(a.y),
y2: e.forceValidValue(a.y),
stroke: e.FINAL_CONFIG.chart.grid.stroke,
"stroke-width": "1",
"stroke-linecap": "round"
}, null, 8, Zt)) : u("", !0),
a.value >= e.niceScale.min && a.value <= e.niceScale.max ? (r(), i("text", {
key: 1,
x: e.drawingArea.left - 7 + e.xPadding,
y: e.checkNaN(a.y + l.fontSizes.dataLabels / 3),
"font-size": l.fontSizes.dataLabels,
"text-anchor": "end",
fill: e.FINAL_CONFIG.chart.grid.labels.color
}, T(e.canShowValue(a.value) ? e.applyDataLabel(
e.FINAL_CONFIG.chart.grid.labels.yAxis.formatter,
a.value,
e.dataLabel({
p: a.prefix,
v: a.value,
s: a.suffix,
r: 1
})
) : ""), 9, Jt)) : u("", !0)
]))), 128))
])) : u("", !0),
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i("g", {
key: `serie_plot_${c}`,
class: B(`serie_plot_${c}`),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i("g", {
key: `circle_plot_${c}_${h}`
}, [
n && e.canShowValue(n.value) ? (r(), D(G, {
key: 0,
shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(a.shape) ? a.shape : "circle",
color: e.FINAL_CONFIG.plot.useGradient ? `url(#plotGradient_${c}_${l.uniqueId})` : e.FINAL_CONFIG.plot.dot.useSerieColor ? a.color : e.FINAL_CONFIG.plot.dot.fill,
plot: { x: e.checkNaN(n.x), y: e.checkNaN(n.y) },
radius: l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h ? (l.plotRadii.plot || 6) * 1.5 : l.plotRadii.plot || 6,
stroke: e.FINAL_CONFIG.plot.dot.useSerieColor ? e.FINAL_CONFIG.chart.backgroundColor : a.color,
strokeWidth: e.FINAL_CONFIG.plot.dot.strokeWidth
}, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth"])) : u("", !0),
n.comment && e.FINAL_CONFIG.chart.comments.show ? (r(), i("foreignObject", {
key: 1,
style: { overflow: "visible" },
height: "12",
width: e.FINAL_CONFIG.chart.comments.width,
x: n.x - e.FINAL_CONFIG.chart.comments.width / 2 + e.FINAL_CONFIG.chart.comments.offsetX,
y: n.y + e.FINAL_CONFIG.chart.comments.offsetY + 6
}, [
f("div", Qt, [
S(t.$slots, "plot-comment", {
plot: { ...n, color: a.color, seriesIndex: c, datapointIndex: h }
}, void 0, !0)
])
], 8, Kt)) : u("", !0)
]))), 128)),
Object.hasOwn(a, "useProgression") && a.useProgression === !0 && !isNaN(e.calcLinearProgression(a.plots).trend) ? (r(), i("g", jt, [
f("defs", null, [
f("marker", {
id: `plot_arrow_${c}`,
markerWidth: 7,
markerHeight: 7,
refX: "0",
refY: 7 / 2,
orient: "auto"
}, [
f("polygon", {
points: `0 0, 7 ${7 / 2}, 0 7`,
fill: a.color
}, null, 8, el)
], 8, $t)
]),
a.plots.length > 1 ? (r(), i("line", {
key: 0,
x1: e.calcLinearProgression(a.plots).x1,
x2: e.calcLinearProgression(a.plots).x2,
y1: e.forceValidValue(e.calcLinearProgression(a.plots).y1),
y2: e.forceValidValue(e.calcLinearProgression(a.plots).y2),
"stroke-width": 1,
stroke: a.color,
"stroke-dasharray": 2,
"marker-end": `url(#plot_arrow_${c})`
}, null, 8, tl)) : u("", !0),
a.plots.length > 1 ? (r(), i("text", {
key: 1,
"text-anchor": "middle",
x: e.calcLinearProgression(a.plots).x2,
y: e.calcLinearProgression(a.plots).y2 - 6,
"font-size": l.fontSizes.plotLabels,
fill: a.color
}, T(e.dataLabel({
v: e.calcLinearProgression(a.plots).trend * 100,
s: "%",
r: 2
})), 9, ll)) : u("", !0)
])) : u("", !0)
], 6))), 128)),
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i("g", {
key: `serie_line_${c}`,
class: B(`serie_line_${c}`),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
a.smooth && a.plots.length > 1 ? (r(), i("path", {
key: 0,
d: `M${a.curve}`,
stroke: e.FINAL_CONFIG.chart.backgroundColor,
"stroke-width": e.FINAL_CONFIG.line.strokeWidth + 1,
"stroke-dasharray": a.dashed ? e.FINAL_CONFIG.line.strokeWidth * 2 : 0,
fill: "none"
}, null, 8, al)) : a.plots.length > 1 ? (r(), i("path", {
key: 1,
d: `M${a.straight}`,
stroke: e.FINAL_CONFIG.chart.backgroundColor,
"stroke-width": e.FINAL_CONFIG.line.strokeWidth + 1,
"stroke-dasharray": a.dashed ? e.FINAL_CONFIG.line.strokeWidth * 2 : 0,
fill: "none",
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, null, 8, rl)) : u("", !0)
], 6))), 128)),
t.$slots.pattern ? (r(), i("defs", il, [
(r(!0), i(d, null, I(e.safeDataset, (a, c) => S(t.$slots, "pattern", K({
key: `serie_pattern_slot_${c}`,
ref_for: !0
}, { ...a, seriesIndex: a.slotAbsoluteIndex, patternId: `pattern_${l.uniqueId}_${c}` }), void 0, !0)), 128))
])) : u("", !0),
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i("g", {
key: `serie_line_${c}`,
class: B(`serie_line_${c}`),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
a.useArea && a.plots.length > 1 ? (r(), i("g", sl, [
a.smooth ? (r(), i(d, { key: 0 }, [
f("path", {
d: `M ${a.plots[0] ? a.plots[0].x : Math.min(...a.plots.filter((n) => !!n).map((n) => n.x))},${l.mutableConfig.isStacked ? e.drawingArea.bottom - a.yOffset : e.drawingArea.bottom} ${a.curve} L ${a.plots.at(-1) ? a.plots.at(-1).x : e.drawingArea.left + e.slot.line * c + e.slot.line / 2},${l.mutableConfig.isStacked ? e.drawingArea.bottom - a.yOffset : e.drawingArea.bottom} Z`,
fill: e.FINAL_CONFIG.line.area.useGradient ? `url(#areaGradient_${c}_${l.uniqueId})` : e.setOpacity(a.color, e.FINAL_CONFIG.line.area.opacity)
}, null, 8, nl),
t.$slots.pattern ? (r(), i("path", {
key: 0,
d: `M ${a.plots[0] ? a.plots[0].x : Math.min(...a.plots.filter((n) => !!n).map((n) => n.x))},${l.mutableConfig.isStacked ? e.drawingArea.bottom - a.yOffset : e.drawingArea.bottom} ${a.curve} L ${a.plots.at(-1) ? a.plots.at(-1).x : e.drawingArea.left + e.slot.line * c + e.slot.line / 2},${l.mutableConfig.isStacked ? e.drawingArea.bottom - a.yOffset : e.drawingArea.bottom} Z`,
fill: `url(#pattern_${l.uniqueId}_${a.slotAbsoluteIndex})`
}, null, 8, cl)) : u("", !0)
], 64)) : (r(), i(d, { key: 1 }, [
f("path", {
d: `M${a.area}Z`,
fill: e.FINAL_CONFIG.line.area.useGradient ? `url(#areaGradient_${c}_${l.uniqueId})` : e.setOpacity(a.color, e.FINAL_CONFIG.line.area.opacity)
}, null, 8, ol),
t.$slots.pattern ? (r(), i("path", {
key: 0,
d: `M${a.area}Z`,
fill: `url(#pattern_${l.uniqueId}_${a.slotAbsoluteIndex})`
}, null, 8, hl)) : u("", !0)
], 64))
])) : u("", !0),
a.smooth && a.plots.length > 1 ? (r(), i("path", {
key: 1,
d: `M${a.curve}`,
stroke: a.color,
"stroke-width": e.FINAL_CONFIG.line.strokeWidth,
"stroke-dasharray": a.dashed ? e.FINAL_CONFIG.line.strokeWidth * 2 : 0,
fill: "none",
"stroke-linecap": "round"
}, null, 8, ul)) : a.plots.length > 1 ? (r(), i("path", {
key: 2,
d: `M${a.straight}`,
stroke: a.color,
"stroke-width": e.FINAL_CONFIG.line.strokeWidth,
"stroke-dasharray": a.dashed ? e.FINAL_CONFIG.line.strokeWidth * 2 : 0,
fill: "none",
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, null, 8, dl)) : u("", !0),
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `circle_line_${c}_${h}`
}, [
!e.optimize.linePlot && n && e.canShowValue(n.value) || e.optimize.linePlot && n && e.canShowValue(n.value) && (l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h) ? (r(), D(G, {
key: 0,
shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(a.shape) ? a.shape : "circle",
color: e.FINAL_CONFIG.line.useGradient ? `url(#lineGradient_${c}_${l.uniqueId})` : e.FINAL_CONFIG.line.dot.useSerieColor ? a.color : e.FINAL_CONFIG.line.dot.fill,
plot: { x: e.checkNaN(n.x), y: e.checkNaN(n.y) },
radius: l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h ? (l.plotRadii.line || 6) * 1.5 : l.plotRadii.line || 6,
stroke: e.FINAL_CONFIG.line.dot.useSerieColor ? e.FINAL_CONFIG.chart.backgroundColor : a.color,
strokeWidth: e.FINAL_CONFIG.line.dot.strokeWidth
}, null, 8, ["shape", "color", "plot", "radius", "stroke", "strokeWidth"])) : u("", !0),
n.comment && e.FINAL_CONFIG.chart.comments.show ? (r(), i("foreignObject", {
key: 1,
style: { overflow: "visible" },
height: "12",
width: e.FINAL_CONFIG.chart.comments.width,
x: n.x - e.FINAL_CONFIG.chart.comments.width / 2 + e.FINAL_CONFIG.chart.comments.offsetX,
y: n.y + e.FINAL_CONFIG.chart.comments.offsetY + 6
}, [
f("div", fl, [
S(t.$slots, "plot-comment", {
plot: { ...n, color: a.color, seriesIndex: c, datapointIndex: h }
}, void 0, !0)
])
], 8, gl)) : u("", !0)
], 64))), 128)),
Object.hasOwn(a, "useProgression") && a.useProgression === !0 && !isNaN(e.calcLinearProgression(a.plots).trend) ? (r(), i("g", Il, [
f("defs", null, [
f("marker", {
id: `line_arrow_${c}`,
markerWidth: 7,
markerHeight: 7,
refX: "0",
refY: 7 / 2,
orient: "auto"
}, [
f("polygon", {
points: `0 0, 7 ${7 / 2}, 0 7`,
fill: a.color
}, null, 8, Nl)
], 8, ml)
]),
a.plots.length > 1 ? (r(), i("line", {
key: 0,
x1: e.calcLinearProgression(a.plots).x1,
x2: e.calcLinearProgression(a.plots).x2,
y1: e.forceValidValue(e.calcLinearProgression(a.plots).y1),
y2: e.forceValidValue(e.calcLinearProgression(a.plots).y2),
"stroke-width": 1,
stroke: a.color,
"stroke-dasharray": 2,
"marker-end": `url(#line_arrow_${c})`
}, null, 8, xl)) : u("", !0),
a.plots.length > 1 ? (r(), i("text", {
key: 1,
"text-anchor": "middle",
x: e.calcLinearProgression(a.plots).x2,
y: e.calcLinearProgression(a.plots).y2 - 6,
"font-size": l.fontSizes.plotLabels,
fill: a.color
}, T(e.dataLabel({
v: e.calcLinearProgression(a.plots).trend * 100,
s: "%",
r: 2
})), 9, bl)) : u("", !0)
])) : u("", !0)
], 6))), 128)),
(e.FINAL_CONFIG.bar.labels.show || e.FINAL_CONFIG.bar.serieName.show) && l.mutableConfig.dataLabels.show ? (r(), i("g", Fl, [
(r(!0), i(d, null, I(e.barSet, (a, c) => (r(), i(d, {
key: `xLabel_bar_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_bar_${c}_${h}`
}, [
n && (!Object.hasOwn(a, "dataLabels") || a.dataLabels === !0 || l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h) && e.FINAL_CONFIG.bar.labels.show ? (r(), i("text", {
key: 0,
x: l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? n.x + e.slot.line / 2 : e.calcRectX(n) + e.calcRectWidth() / 2 - e.barPeriodGap / 2,
y: e.checkNaN(n.y) + (n.value >= 0 ? e.FINAL_CONFIG.bar.labels.offsetY : -e.FINAL_CONFIG.bar.labels.offsetY * 3),
"text-anchor": "middle",
"font-size": l.fontSizes.plotLabels,
fill: e.FINAL_CONFIG.bar.labels.color,
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, T(e.canShowValue(n.value) ? e.applyDataLabel(
e.FINAL_CONFIG.bar.labels.formatter,
n.value,
e.dataLabel({
p: a.prefix || e.FINAL_CONFIG.chart.labels.prefix,
v: n.value,
s: a.suffix || e.FINAL_CONFIG.chart.labels.suffix,
r: e.FINAL_CONFIG.bar.labels.rounding
}),
{
datapoint: n,
serie: a
}
) : ""), 13, _l)) : u("", !0),
n && e.FINAL_CONFIG.bar.serieName.show ? (r(), i("text", {
key: 1,
x: l.mutableConfig.useIndividualScale && l.mutableConfig.isStacked ? n.x + e.slot.line / 2 : n.x + e.calcRectWidth() * 1.1,
y: n.y + (n.value > 0 ? e.FINAL_CONFIG.bar.serieName.offsetY : -e.FINAL_CONFIG.bar.serieName.offsetY * 3),
"text-anchor": "middle",
"font-size": l.fontSizes.plotLabels,
fill: e.FINAL_CONFIG.bar.serieName.useSerieColor ? a.color : e.FINAL_CONFIG.bar.serieName.color,
"font-weight": e.FINAL_CONFIG.bar.serieName.bold ? "bold" : "normal",
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, T(e.FINAL_CONFIG.bar.serieName.useAbbreviation ? e.abbreviate({ source: a.name, length: e.FINAL_CONFIG.bar.serieName.abbreviationSize }) : a.name), 13, yl)) : u("", !0)
], 64))), 128))
], 64))), 128))
])) : u("", !0),
e.FINAL_CONFIG.plot.labels.show && l.mutableConfig.dataLabels.show ? (r(), i("g", Al, [
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i(d, {
key: `xLabel_plot_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_plot_${c}_${h}`
}, [
n && !Object.hasOwn(a, "dataLabels") || a.dataLabels === !0 || l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h ? (r(), i("text", {
key: 0,
x: n.x,
y: n.y + e.FINAL_CONFIG.plot.labels.offsetY,
"text-anchor": "middle",
"font-size": l.fontSizes.plotLabels,
fill: e.FINAL_CONFIG.plot.labels.color,
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, T(e.canShowValue(n.value) ? e.applyDataLabel(
e.FINAL_CONFIG.plot.labels.formatter,
n.value,
e.dataLabel({
p: a.prefix || e.FINAL_CONFIG.chart.labels.prefix,
v: n.value,
s: a.suffix || e.FINAL_CONFIG.chart.labels.suffix,
r: e.FINAL_CONFIG.plot.labels.rounding
}),
{
datapoint: n,
serie: a
}
) : ""), 13, Ll)) : u("", !0)
], 64))), 128))
], 64))), 128))
])) : (r(), i("g", Cl, [
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i(d, {
key: `xLabel_plot_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_plot_${c}_${h}`
}, [
e.FINAL_CONFIG.plot.tag.followValue ? (r(), i(d, { key: 1 }, [
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag ? (r(), i("line", {
key: 0,
class: "vue-ui-xy-tag-plot",
x1: e.drawingArea.left,
x2: e.drawingArea.right,
y1: n.y,
y2: n.y,
"stroke-width": 1,
"stroke-linecap": "round",
"stroke-dasharray": "2",
stroke: a.color
}, null, 8, Gl)) : u("", !0)
], 64)) : (r(), i(d, { key: 0 }, [
n && h === 0 && a.useTag && a.useTag === "start" ? (r(), i("foreignObject", {
key: 0,
x: n.x,
y: n.y - 20,
height: 24,
width: "150",
style: x(`overflow: visible; opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
f("div", {
style: x(`padding: 3px; background:${e.setOpacity(a.color, 80)};color:${e.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`),
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.plot.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 12, kl)
], 12, Sl)) : u("", !0),
n && h === a.plots.length - 1 && a.useTag && a.useTag === "end" ? (r(), i("foreignObject", {
key: 1,
x: n.x - a.name.length * (l.fontSizes.plotLabels / 2),
y: n.y - 20,
height: 24,
width: "150",
style: x(`overflow: visible; opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
f("div", {
style: x(`padding: 3px; background:${e.setOpacity(a.color, 80)};color:${e.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`),
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.plot.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 12, Ol)
], 12, wl)) : u("", !0)
], 64))
], 64))), 128))
], 64))), 128))
])),
e.FINAL_CONFIG.line.labels.show && l.mutableConfig.dataLabels.show ? (r(), i("g", vl, [
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i(d, {
key: `xLabel_line_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_line_${c}_${h}`
}, [
n && !Object.hasOwn(a, "dataLabels") || a.dataLabels === !0 || l.selectedSerieIndex !== null && l.selectedSerieIndex === h || l.selectedMinimapIndex !== null && l.selectedMinimapIndex === h ? (r(), i("text", {
key: 0,
x: n.x,
y: n.y + (n.value >= 0 ? e.FINAL_CONFIG.line.labels.offsetY : -e.FINAL_CONFIG.line.labels.offsetY * 3),
"text-anchor": "middle",
"font-size": l.fontSizes.plotLabels,
fill: e.FINAL_CONFIG.line.labels.color,
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, T(e.canShowValue(n.value) ? e.applyDataLabel(
e.FINAL_CONFIG.line.labels.formatter,
n.value,
e.dataLabel({
p: a.prefix || e.FINAL_CONFIG.chart.labels.prefix,
v: n.value,
s: a.suffix || e.FINAL_CONFIG.chart.labels.suffix,
r: e.FINAL_CONFIG.line.labels.rounding
}),
{
datapoint: n,
serie: a
}
) : ""), 13, pl)) : u("", !0)
], 64))), 128))
], 64))), 128))
])) : (r(), i("g", Ml, [
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i(d, {
key: `xLabel_line_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_line_${c}_${h}`
}, [
e.FINAL_CONFIG.line.tag.followValue ? (r(), i(d, { key: 1 }, [
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag ? (r(), i("line", {
key: 0,
class: "vue-ui-xy-tag-line",
x1: e.drawingArea.left,
x2: e.drawingArea.right,
y1: n.y,
y2: n.y,
"stroke-width": 1,
"stroke-linecap": "round",
"stroke-dasharray": "2",
stroke: a.color
}, null, 8, Rl)) : u("", !0)
], 64)) : (r(), i(d, { key: 0 }, [
n && h === 0 && a.useTag && a.useTag === "start" ? (r(), i("foreignObject", {
key: 0,
x: n.x,
y: n.y - 20,
height: 24,
width: "150",
style: x(`overflow: visible; opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
f("div", {
style: x(`padding: 3px; background:${e.setOpacity(a.color, 80)};color:${e.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`),
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.line.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 12, Tl)
], 12, zl)) : u("", !0),
n && h === a.plots.length - 1 && a.useTag && a.useTag === "end" ? (r(), i("foreignObject", {
key: 1,
x: n.x,
y: n.y - 20,
height: 24,
width: "150",
style: x(`overflow: visible; opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, [
f("div", {
style: x(`padding: 3px; background:${e.setOpacity(a.color, 80)};color:${e.adaptColorToBackground(a.color)};width:fit-content;font-size:${l.fontSizes.plotLabels}px;border-radius: 2px;`),
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.line.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 12, Vl)
], 12, Pl)) : u("", !0)
], 64))
], 64))), 128))
], 64))), 128))
])),
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i(d, {
key: `xLabel_line_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_line_${c}_${h}`
}, [
n && h === 0 && a.showSerieName && a.showSerieName === "start" ? (r(), i("text", {
key: 0,
x: n.x - l.fontSizes.plotLabels,
y: n.y,
"font-size": l.fontSizes.plotLabels,
"text-anchor": "end",
fill: a.color,
innerHTML: e.createTSpans({
content: a.name,
fontSize: l.fontSizes.plotLabels,
fill: a.color,
x: n.x - l.fontSizes.plotLabels,
y: n.y,
maxWords: 2
}),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, null, 12, Hl)) : u("", !0),
n && h === a.plots.length - 1 && a.showSerieName && a.showSerieName === "end" ? (r(), i("text", {
key: 1,
x: n.x + l.fontSizes.plotLabels,
y: n.y,
"font-size": l.fontSizes.plotLabels,
"text-anchor": "start",
fill: a.color,
innerHTML: e.createTSpans({
content: a.name,
fontSize: l.fontSizes.plotLabels,
fill: a.color,
x: n.x + l.fontSizes.plotLabels,
y: n.y,
maxWords: 2
}),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, null, 12, Dl)) : u("", !0)
], 64))), 128))
], 64))), 128)),
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i(d, {
key: `xLabel_plot_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `xLabel_plot_${c}_${h}`
}, [
n && h === 0 && a.showSerieName && a.showSerieName === "start" ? (r(), i("text", {
key: 0,
x: n.x - l.fontSizes.plotLabels,
y: n.y,
"font-size": l.fontSizes.plotLabels,
"text-anchor": "end",
fill: a.color,
innerHTML: e.createTSpans({
content: a.name,
fontSize: l.fontSizes.plotLabels,
fill: a.color,
x: n.x - l.fontSizes.plotLabels,
y: n.y,
maxWords: 2
}),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, null, 12, Bl)) : u("", !0),
n && h === a.plots.length - 1 && a.showSerieName && a.showSerieName === "end" ? (r(), i("text", {
key: 1,
x: n.x + l.fontSizes.plotLabels,
y: n.y,
"font-size": l.fontSizes.plotLabels,
"text-anchor": "start",
fill: a.color,
innerHTML: e.createTSpans({
content: a.name,
fontSize: l.fontSizes.plotLabels,
fill: a.color,
x: n.x + l.fontSizes.plotLabels,
y: n.y,
maxWords: 2
}),
style: x(`opacity:${l.selectedScale ? l.selectedScale === a.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`)
}, null, 12, El)) : u("", !0)
], 64))), 128))
], 64))), 128)),
l.mutableConfig.useIndividualScale && !l.mutableConfig.isStacked ? (r(), i(d, { key: 11 }, [
f("defs", null, [
(r(!0), i(d, null, I(e.allScales, (a, c) => (r(), i("linearGradient", {
id: `individual_scale_gradient_${l.uniqueId}_${c}`,
x1: "0%",
x2: "100%",
y1: "0%",
y2: "0%"
}, [
f("stop", {
offset: "0%",
"stop-color": e.FINAL_CONFIG.chart.backgroundColor,
"stop-opacity": "0"
}, null, 8, Yl),
f("stop", {
offset: "100%",
"stop-color": a.color,
"stop-opacity": "0.2"
}, null, 8, ql)
], 8, Wl))), 256))
]),
(r(!0), i(d, null, I(e.allScales, (a, c) => (r(), i("rect", {
x: a.x - e.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth + e.xPadding,
y: e.drawingArea.top,
width: e.FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth,
height: e.drawingArea.height < 0 ? 10 : e.drawingArea.height,
fill: l.selectedScale === a.groupId ? `url(#individual_scale_gradient_${l.uniqueId}_${c})` : "transparent",
onMouseenter: (n) => l.selectedScale = a.groupId,
onMouseleave: s[0] || (s[0] = (n) => l.selectedScale = null)
}, null, 40, Xl))), 256))
], 64)) : u("", !0),
f("g", null, [
e.FINAL_CONFIG.chart.grid.labels.axis.yLabel && !l.mutableConfig.useIndividualScale ? (r(), i("text", {
key: 0,
"font-size": l.fontSizes.yAxis,
fill: e.FINAL_CONFIG.chart.grid.labels.color,
transform: `translate(${l.fontSizes.yAxis + e.FINAL_CONFIG.chart.grid.labels.axis.yLabelOffsetX}, ${e.drawingArea.top + e.drawingArea.height / 2}) rotate(-90)`,
"text-anchor": "middle",
style: { transition: "none" }
}, T(e.FINAL_CONFIG.chart.grid.labels.axis.yLabel), 9, Ul)) : u("", !0),
e.FINAL_CONFIG.chart.grid.labels.axis.xLabel ? (r(), i("text", {
key: 1,
"text-anchor": "middle",
x: l.width / 2,
y: e.drawingArea.bottom + l.fontSizes.yAxis + l.fontSizes.xAxis * 1.3 + e.FINAL_CONFIG.chart.grid.labels.axis.xLabelOffsetY,
"font-size": l.fontSizes.yAxis,
fill: e.FINAL_CONFIG.chart.grid.labels.color
}, T(e.FINAL_CONFIG.chart.grid.labels.axis.xLabel), 9, Zl)) : u("", !0)
]),
s[9] || (s[9] = J('v-for="(label, i) in timeLabels" :key="`time_label_${i}`" ')),
e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.show ? (r(), i("g", Jl, [
t.$slots["time-label"] ? (r(!0), i(d, { key: 0 }, I(e.timeLabels, (a, c) => S(t.$slots, "time-label", K({
key: `time_label_${c}`,
ref_for: !0
}, {
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * c + e.drawingArea.width / e.maxSeries / 2,
y: e.drawingArea.bottom + l.fontSizes.xAxis * 1.3 + e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.yOffset,
fontSize: l.fontSizes.xAxis,
fill: e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.color,
transform: `translate(${e.drawingArea.left + e.drawingArea.width / e.maxSeries * c + e.drawingArea.width / e.maxSeries / 2}, ${e.drawingArea.bottom + l.fontSizes.xAxis * 1.3 + e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.yOffset}), rotate(${e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation})`,
absoluteIndex: a.absoluteIndex,
content: a.text,
textAnchor: e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
show: a && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && (c === 0 || c === e.timeLabels.length - 1) && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && l.selectedSerieIndex === c && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo && c % Math.floor((this.slicer.end - this.slicer.start) / e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.modulo) === 0
}), void 0, !0)), 128)) : (r(!0), i(d, { key: 1 }, I(e.timeLabels, (a, c) => (r(), i("g", {
key: `time_label_${c}`
}, [
a && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && (c === 0 || c === e.timeLabels.length - 1) && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && l.selectedSerieIndex === c && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo || a && !e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo && c % Math.floor((this.slicer.end - this.slicer.start) / e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.modulo) === 0 ? (r(), i("text", {
key: 0,
"text-anchor": e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation > 0 ? "start" : e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation < 0 ? "end" : "middle",
"font-size": l.fontSizes.xAxis,
fill: e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.color,
transform: `translate(${e.drawingArea.left + e.drawingArea.width / e.maxSeries * c + e.drawingArea.width / e.maxSeries / 2}, ${e.drawingArea.bottom + l.fontSizes.xAxis * 1.3 + e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.yOffset}), rotate(${e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.rotation})`,
style: {
cursor: "pointer"
},
onClick: () => e.selectTimeLabel(a, c)
}, T(a.text || ""), 9, Kl)) : u("", !0)
]))), 128))
])) : u("", !0),
f("g", null, [
(r(!0), i(d, null, I(e.maxSeries, (a, c) => (r(), i("rect", {
key: `tooltip_trap_${c}`,
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * c,
y: e.drawingArea.top,
height: e.drawingArea.height < 0 ? 10 : e.drawingArea.height,
width: e.drawingArea.width / e.maxSeries < 0 ? 1e-5 : e.drawingArea.width / e.maxSeries,
fill: "transparent",
onMouseenter: (n) => e.toggleTooltipVisibility(!0, c),
onMouseleave: s[1] || (s[1] = (n) => e.toggleTooltipVisibility(!1)),
onClick: (n) => e.selectX(c)
}, null, 40, Ql))), 128))
]),
e.FINAL_CONFIG.chart.timeTag.show && (![null, void 0].includes(l.selectedSerieIndex) || ![null, void 0].includes(l.selectedMinimapIndex)) ? (r(), i("g", jl, [
(r(), i("foreignObject", {
x: e.drawingArea.left + e.drawingArea.width / e.maxSeries * ((l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)) - 100 + e.drawingArea.width / e.maxSeries / 2,
y: e.drawingArea.bottom,
width: "200",
height: "40",
style: { overflow: "visible !important" }
}, [
f("div", {
class: "vue-ui-xy-time-tag",
style: x(`width: fit-content;margin: 0 auto;text-align:center;padding:3px 12px;background:${e.FINAL_CONFIG.chart.timeTag.backgroundColor};color:${e.FINAL_CONFIG.chart.timeTag.color};font-size:${e.FINAL_CONFIG.chart.timeTag.fontSize}px`)
}, T(e.timeLabels[(l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)].text || (l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)), 5)
], 8, $l)),
f("circle", {
cx: e.drawingArea.left + e.drawingArea.width / e.maxSeries * ((l.selectedSerieIndex !== null ? l.selectedSerieIndex : 0) || (l.selectedMinimapIndex !== null ? l.selectedMinimapIndex : 0)) + e.drawingArea.width / e.maxSeries / 2,
cy: e.drawingArea.bottom,
r: e.FINAL_CONFIG.chart.timeTag.circleMarker.radius,
fill: e.FINAL_CONFIG.chart.timeTag.circleMarker.color
}, null, 8, ea)
])) : u("", !0)
])) : u("", !0),
S(t.$slots, "svg", { svg: e.svg }, void 0, !0)
], 14, $e)) : u("", !0),
t.$slots.watermark ? (r(), i("div", ta, [
S(t.$slots, "watermark", E(W({ isPrinting: l.isPrinting || l.isImaging })), void 0, !0)
])) : u("", !0),
(r(!0), i(d, null, I(e.lineSet, (a, c) => (r(), i(d, {
key: `tag_line_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `tag_line_${c}_${h}`
}, [
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag && a.useTag === "end" && e.FINAL_CONFIG.line.tag.followValue ? (r(), i("div", {
key: 0,
ref_for: !0,
ref: (F) => e.setTagRef(c, h, F, "right", "line"),
class: "vue-ui-xy-tag",
"data-tag": "right",
style: x({
position: "fixed",
top: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.right + e.FINAL_CONFIG.line.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_right_line`],
position: "right"
}).top + "px",
left: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.right + e.FINAL_CONFIG.line.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_right_line`],
position: "right"
}).left + "px",
height: "fit-content",
width: "fit-content",
background: a.color,
color: e.adaptColorToBackground(a.color),
padding: "0 6px",
fontSize: e.FINAL_CONFIG.line.tag.fontSize + "px",
opacity: 1
})
}, [
(r(), i("svg", la, [
f("path", {
d: "M 0,10 10,0 10,20 Z",
fill: a.color,
stroke: "none"
}, null, 8, aa)
])),
f("div", {
class: "vue-ui-xy-tag-content",
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.line.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 8, ra)
], 4)) : u("", !0),
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag && a.useTag === "start" && e.FINAL_CONFIG.line.tag.followValue ? (r(), i("div", {
key: 1,
ref_for: !0,
ref: (F) => e.setTagRef(c, h, F, "left", "line"),
class: "vue-ui-xy-tag",
"data-tag": "left",
style: x({
position: "fixed",
top: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.left - e.FINAL_CONFIG.line.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_left_line`],
position: "left"
}).top + "px",
left: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.left - e.FINAL_CONFIG.line.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_left_line`],
position: "left"
}).left + "px",
height: "fit-content",
width: "fit-content",
background: a.color,
color: e.adaptColorToBackground(a.color),
padding: "0 6px",
fontSize: e.FINAL_CONFIG.line.tag.fontSize + "px",
opacity: 1
})
}, [
(r(), i("svg", ia, [
f("path", {
d: "M 0,0 10,10 0,20 Z",
fill: a.color,
stroke: "none"
}, null, 8, sa)
])),
f("div", {
class: "vue-ui-xy-tag-content",
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.line.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 8, na)
], 4)) : u("", !0)
], 64))), 128))
], 64))), 128)),
(r(!0), i(d, null, I(e.plotSet, (a, c) => (r(), i(d, {
key: `tag_plot_${c}`
}, [
(r(!0), i(d, null, I(a.plots, (n, h) => (r(), i(d, {
key: `tag_plot_${c}_${h}`
}, [
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag && a.useTag === "end" && e.FINAL_CONFIG.plot.tag.followValue ? (r(), i("div", {
key: 0,
ref_for: !0,
ref: (F) => e.setTagRef(c, h, F, "right", "plot"),
class: "vue-ui-xy-tag",
"data-tag": "right",
style: x({
position: "fixed",
top: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.right + e.FINAL_CONFIG.plot.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_right_plot`],
position: "right"
}).top + "px",
left: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.right + e.FINAL_CONFIG.plot.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_right_plot`],
position: "right"
}).left + "px",
height: "fit-content",
width: "fit-content",
background: a.color,
color: e.adaptColorToBackground(a.color),
padding: "0 6px",
fontSize: e.FINAL_CONFIG.plot.tag.fontSize + "px",
opacity: 1
})
}, [
(r(), i("svg", ca, [
f("path", {
d: "M 0,10 10,0 10,20 Z",
fill: a.color,
stroke: "none"
}, null, 8, oa)
])),
f("div", {
class: "vue-ui-xy-tag-content",
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.plot.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 8, ha)
], 4)) : u("", !0),
[l.selectedMinimapIndex, l.selectedSerieIndex, l.selectedRowIndex].includes(h) && a.useTag && a.useTag === "start" && e.FINAL_CONFIG.plot.tag.followValue ? (r(), i("div", {
key: 1,
ref_for: !0,
ref: (F) => e.setTagRef(c, h, F, "left", "plot"),
class: "vue-ui-xy-tag",
"data-tag": "left",
style: x({
position: "fixed",
top: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.left - e.FINAL_CONFIG.plot.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_left_plot`],
position: "left"
}).top + "px",
left: e.placeXYTag({
svgElement: l.svgRef,
x: e.drawingArea.left - e.FINAL_CONFIG.plot.tag.fontSize / 1.5,
y: n.y,
element: l.tagRefs[`${c}_${h}_left_plot`],
position: "left"
}).left + "px",
height: "fit-content",
width: "fit-content",
background: a.color,
color: e.adaptColorToBackground(a.color),
padding: "0 6px",
fontSize: e.FINAL_CONFIG.plot.tag.fontSize + "px",
opacity: 1
})
}, [
(r(), i("svg", ua, [
f("path", {
d: "M 0,0 10,10 0,20 Z",
fill: a.color,
stroke: "none"
}, null, 8, da)
])),
f("div", {
class: "vue-ui-xy-tag-content",
innerHTML: e.applyDataLabel(
e.FINAL_CONFIG.plot.tag.formatter,
n.value,
a.name,
{
datapoint: n,
seriesIndex: h,
serieName: a.name
}
)
}, null, 8, ga)
], 4)) : u("", !0)
], 64))), 128))
], 64))), 128)),
e.isDataset ? u("", !0) : (r(), D(w, {
key: 6,
config: {
type: "line",
style: {
backgroundColor: e.FINAL_CONFIG.chart.backgroundColor,
line: {
axis: {
color: e.FINAL_CONFIG.chart.grid.stroke
},
path: {
color: e.FINAL_CONFIG.chart.grid.stroke,
strokeWidth: 0.5
}
}
}
}
}, null, 8, ["config"])),
e.FINAL_CONFIG.chart.zoom.show && l.maxX > 6 && e.isDataset ? (r(), D(v, {
ref: "chartSlicer",
key: `slicer_${l.slicerStep}`,
background: e.FINAL_CONFIG.chart.zoom.color,
fontSize: e.FINAL_CONFIG.chart.zoom.fontSize,
useResetSlot: e.FINAL_CONFIG.chart.zoom.useResetSlot,
labelLeft: e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[l.slicer.start],
labelRight: e.FINAL_CONFIG.chart.grid.labels.xAxisLabels.values[l.slicer.end - 1],
textColor: e.FINAL_CONFIG.chart.color,
inputColor: e.FINAL_CONFIG.chart.zoom.color,
selectColor: e.FINAL_CONFIG.chart.zoom.highlightColor,
borderColor: e.FINAL_CONFIG.chart.backgroundColor,
minimap: e.minimap,
smoothMinimap: e.FINAL_CONFIG.chart.zoom.minimap.smooth,
minimapSelectedColor: e.FINAL_CONFIG.chart.zoom.minimap.selectedColor,
minimapSelectionRadius: e.FINAL_CONFIG.chart.zoom.minimap.selectionRadius,
minimapLineColor: e.FINAL_CONFIG.chart.zoom.minimap.lineColor,
minimapSelectedColorOpacity: e.FINAL_CONFIG.chart.zoom.minimap.selectedColorOpacity,
minimapSelectedIndex: l.selectedSerieIndex,
minimapIndicatorColor: e.FINAL_CONFIG.chart.zoom.minimap.indicatorColor,
verticalHandles: e.FINAL_CONFIG.chart.zoom.minimap.verticalHandles,
max: l.maxX,
min: 0,
valueStart: l.slicer.start,
valueEnd: l.slicer.end,
start: l.slicer.start,
"onUpdate:start": s[2] || (s[2] = (a) => l.slicer.start = a),
end: l.slicer.end,
"onUpdate:end": s[3] || (s[3] = (a) => l.slicer.end = a),
refreshStartPoint: e.FINAL_CONFIG.chart.zoom.startIndex !== null ? e.FINAL_CONFIG.chart.zoom.startIndex : 0,
refreshEndPoint: e.FINAL_CONFIG.chart.zoom.endIndex !== null ? e.FINAL_CONFIG.chart.zoom.endIndex + 1 : Math.max(...o.dataset.map((a) => e.largestTriangleThreeBucketsArray({ data: a.series, threshold: e.FINAL_CONFIG.downsample.threshold }).length)),
enableRangeHandles: e.FINAL_CONFIG.chart.zoom.enableRangeHandles,
enableSelectionDrag: e.FINAL_CONFIG.chart.zoom.enableSelectionDrag,
onReset: e.refreshSlicer,
onTrapMouse: e.selectMinimapIndex
}, {
"reset-action": P(({ reset: a }) => [
S(t.$slots, "reset-action", E(W({ reset: a })), void 0, !0)
]),
_: 3
}, 8, ["background", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "borderColor", "minimap", "smoothMinimap", "minimapSelectedColor", "minimapSelectionRadius", "minimapLineColor", "minimapSelectedColorOpacity", "minimapSelectedIndex", "minimapIndicatorColor", "verticalHandles", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag", "onReset", "onTrapMouse"])) : u("", !0),
e.FINAL_CONFIG.chart.legend.show ? (r(), i("div", {
key: 8,
ref: "chartLegend",
class: "vue-ui-xy-legend",
style: x(`font-size:${e.FINAL_CONFIG.chart.legend.fontSize}px`)
}, [
(r(!0), i(d, null, I(e.absoluteDataset, (a, c) => (r(), i("div", {
key: `div_legend_item_${c}`,
onClick: (n) => e.segregate(a),
class: B({ "vue-ui-xy-legend-item": !0, "vue-ui-xy-legend-item-segregated": l.segregatedSeries.includes(a.id) })
}, [
l.icons[a.type] === "line" ? (r(), i("svg", Ia, [
f("rect", {
x: "0",
y: "7.5",
rx: "1.5",
stroke: e.FINAL_CONFIG.chart.backgroundColor,
"stroke-width": 0.5,
height: "3",
width: "20",
fill: a.color
}, null, 8, ma),
Y(G, {
plot: { x: 10, y: 9 },
radius: 4,
color: a.color,
shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(a.shape) ? a.shape : "circle",
stroke: e.FINAL_CONFIG.chart.backgroundColor,
strokeWidth: 0.5
}, null, 8, ["color", "shape", "stroke"])
])) : l.icons[a.type] === "bar" ? (r(), i("svg", Na, [
l.icons[a.type] === "bar" && t.$slots.pattern ? (r(), i("rect", {
key: 0,
x: "0",
y: "0",
rx: "1",
height: "40",
width: "40",
stroke: "none",
fill: a.color
}, null, 8, xa)) : u("", !0),
l.icons[a.type] === "bar" ? (r(), i("rect", {
key: 1,
x: "0",
y: "0",
rx: "1",
height: "40",
width: "40",
stroke: "none",
fill: t.$slots.pattern ? `url(#pattern_${l.uniqueId}_${a.slotAbsoluteIndex})` : a.color
}, null, 8, ba)) : u("", !0)
])) : (r(), i("svg", Fa, [
Y(G, {
plot: { x: 6, y: 6 },
radius: 5,
color: a.color,
shape: ["triangle", "square", "diamond", "pentagon", "hexagon", "star"].includes(a.shape) ? a.shape : "circle"
}, null, 8, ["color", "shape"])
])),
f("span", {
style: x(`color:${e.FINAL_CONFIG.chart.legend.color}`)
}, T(a.name), 5)
], 10, fa))), 128))
], 4)) : (r(), i("div", _a, [
S(t.$slots, "legend", { legend: e.absoluteDataset }, void 0, !0)
], 512)),
t.$slots.source ? (r(), i("div", ya, [
S(t.$slots, "source", {}, void 0, !0)
], 512)) : u("", !0),
Y(O, {
show: l.mutableConfig.showTooltip && l.isTooltip,
backgroundColor: e.FINAL_CONFIG.chart.tooltip.backgroundColor,
color: e.FINAL_CONFIG.chart.tooltip.color,
fontSize: e.FINAL_CONFIG.chart.tooltip.fontSize,
borderRadius: e.FINAL_CONFIG.chart.tooltip.borderRadius,
borderColor: e.FINAL_CONFIG.chart.tooltip.borderColor,
borderWidth: e.FINAL_CONFIG.chart.tooltip.borderWidth,
backgroundOpacity: e.FINAL_CONFIG.chart.tooltip.backgroundOpacity,
position: e.FINAL_CONFIG.chart.tooltip.position,
offsetY: e.FINAL_CONFIG.chart.tooltip.offsetY,
parent: t.$refs.chart,
content: e.tooltipContent,
isFullscreen: l.isFullscreen,
isCustom: e.FINAL_CONFIG.chart.tooltip.customFormat && typeof e.FINAL_CONFIG.chart.tooltip.customFormat == "function"
}, {
"tooltip-before": P(() => [
S(t.$slots, "tooltip-before", E(W({ ...e.dataTooltipSlot })), void 0, !0)
]),
"tooltip-after": P(() => [
S(t.$slots, "tooltip-after", E(W({ ...e.dataTooltipSlot })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
e.isDataset ? (r(), D(V, {
key: 11,
hideDetails: "",
config: {
open: l.mutableConfig.showTable,
maxHeight: 1e4,
body: {
backgroundColor: e.FINAL_CONFIG.chart.backgroundColor,
color: e.FINAL_CONFIG.chart.color
},
head: {
backgroundColor: e.FINAL_CONFIG.chart.backgroundColor,
color: e.FINAL_CONFIG.chart.color
}
}
}, {
content: P(() => [
f("div", {
style: x(`${l.isPrinting ? "" : "max-height:400px"};overflow:auto;width:100%;margin-top:48px`)
}, [
f("div", Aa, [
Xe(f("input", {
type: "checkbox",
"onUpdate:modelValue": s[4] || (s[4] = (a) => l.showSparklineTable = a)
}, null, 512), [
[Ue, l.showSparklineTable]
]),
f("div", {
onClick: s[5] || (s[5] = (a) => l.showSparklineTable = !l.showSparklineTable),
style: { cursor: "pointer" }
}, [
Y(b, {
name: "chartLine",
size: 20,
stroke: e.FINAL_CONFIG.chart.color
}, null, 8, ["stroke"])
])
]),
l.showSparklineTable ? (r(), D(C, {
key: `sparkline_${l.segregateStep}`,
dataset: e.tableSparklineDataset,
config: e.tableSparklineConfig
}, null, 8, ["dataset", "config"])) : (r(), D(p, {
key: `table_${l.tableStep}`,
colNames: e.dataTable.colNames,
head: e.dataTable.head,
body: e.dataTable.body,
config: e.dataTable.config,
title: `${e.FINAL_CONFIG.chart.title.text}${e.FINAL_CONFIG.chart.title.subtitle.text ? ` : ${e.FINAL_CONFIG.chart.title.subtitle.text}` : ""}`,
onClose: s[6] || (s[6] = (a) => l.mutableConfig.showTable = !1)
}, {
th: P(({ th: a }) => [
f("div", { innerHTML: a }, null, 8, La)
]),
td: P(({ td: a }) => [
J(T(isNaN(Number(a)) ? a : e.dataLabel({
p: e.FINAL_CONFIG.chart.labels.prefix,
v: a,
s: e.FINAL_CONFIG.chart.labels.suffix,
r: e.FINAL_CONFIG.table.rounding
})), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
], 4)
]),
_: 1
}, 8, ["config"])) : u("", !0)
], 46, Qe);
}
const Ea = /* @__PURE__ */ Ze(Ke, [["render", Ca], ["__scopeId", "data-v-c0542b9e"]]);
export {
Ea as default
};