@ck-ui/component-library 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.js +226 -226
- package/dist/components/FusionChart/_helpers/doughnutHelper.d.ts.map +1 -1
- package/dist/components/FusionChart/_helpers/doughnutHelper.js +105 -66
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts +1 -0
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
- package/dist/components/FusionChart/_utils/chartHelpers.d.ts +4 -0
- package/dist/components/FusionChart/_utils/chartHelpers.d.ts.map +1 -1
- package/dist/components/FusionChart/_utils/chartHelpers.js +15 -11
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_config/builders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_config/builders.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAk/BpE,eAAO,MAAM,gBAAgB,GAAI,QAAO,OAAO,CAAC,gBAAgB,CAAM;;;;;;;QACD,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { EXTENDED_PALETTE as
|
|
2
|
-
import { getBaseConfig as
|
|
3
|
-
import { getCurrencyPrefix as y, getLabelStep as p, getCartesianPalette as
|
|
4
|
-
const
|
|
5
|
-
const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60),
|
|
1
|
+
import { EXTENDED_PALETTE as $, DEFAULT_WIDTH as m, STACKED_AREA_PALETTE as I } from "../_constant/constants.js";
|
|
2
|
+
import { getBaseConfig as b, getStackedColumnChartShell as F, getStackedAreaChartShell as H, getStackedBarChartShell as O, getLineChartShell as j, getCommonChartShell as N, getScrollAreaChartShell as V, getMultipleLineChartShell as R, getMsCombiDy2dChartShell as W, getGroupChartShell as Y, getDoughnutChartShell as _ } from "./helpers.js";
|
|
3
|
+
import { getCurrencyPrefix as y, getLabelStep as p, getCartesianPalette as L, getCurrencySymbol as E, formatLargeNumber as A, getBarType as M, getGraphDataLength as G } from "../_utils/chartHelpers.js";
|
|
4
|
+
const z = (e = {}) => {
|
|
5
|
+
const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60), l = Array.isArray(e.graphData) ? e.graphData : [], d = l.some((r) => !!r.color), a = L(e?.palettecolors)?.split(",")?.map((r) => r?.trim());
|
|
6
6
|
if (e.usePerBarColors && !Array.isArray(e.graphData)) {
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
const C =
|
|
7
|
+
const r = e.graphData, o = r?.category || [], g = r?.dataset || [];
|
|
8
|
+
if (g.length === 1) {
|
|
9
|
+
const f = (g[0].data || []).map((u, v) => {
|
|
10
|
+
const C = u.color || a[v % a.length], T = o[v]?.label || "";
|
|
11
11
|
return {
|
|
12
|
-
...
|
|
12
|
+
...u,
|
|
13
13
|
color: C,
|
|
14
|
-
toolText: e.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${T}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${C};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${T}</label></span><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${y(e.numberPrefix)}${
|
|
14
|
+
toolText: e.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${T}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${C};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${T}</label></span><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${y(e.numberPrefix)}${u.value || ""}</b></div>`
|
|
15
15
|
};
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
16
|
+
}), x = {
|
|
17
|
+
...N(e),
|
|
18
18
|
bgColor: e.bgColor || "#ffffff",
|
|
19
|
-
labelStep: p(
|
|
19
|
+
labelStep: p(o.length, e.labelStep),
|
|
20
20
|
xAxisName: e.xAxisName,
|
|
21
21
|
yAxisName: e.yAxisName,
|
|
22
22
|
chartBottomMargin: e.chartBottomMargin,
|
|
@@ -31,27 +31,27 @@ const M = (e = {}) => {
|
|
|
31
31
|
maxLabelHeight: e.maxLabelHeight,
|
|
32
32
|
numbersuffix: e.numbersuffix || ""
|
|
33
33
|
};
|
|
34
|
-
return
|
|
35
|
-
type:
|
|
34
|
+
return b({
|
|
35
|
+
type: M(e),
|
|
36
36
|
width: m,
|
|
37
37
|
height: e.height || "300",
|
|
38
|
-
dataSource: { chart:
|
|
38
|
+
dataSource: { chart: x, data: f }
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
let
|
|
45
|
-
return
|
|
46
|
-
...
|
|
47
|
-
color:
|
|
48
|
-
toolText:
|
|
42
|
+
const i = l?.map((r, o) => {
|
|
43
|
+
const g = r?.color || a[o % a.length];
|
|
44
|
+
let h;
|
|
45
|
+
return r.toolText ? h = r.toolText : e.plotToolText ? h = e.plotToolText : h = `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${r.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${g};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${r.label || ""}</label></span><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${y(e.numberPrefix)}${r.value || ""}</b></div>`, {
|
|
46
|
+
...r,
|
|
47
|
+
color: g,
|
|
48
|
+
toolText: h
|
|
49
49
|
// toolText: props.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${item.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${itemColor};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${item.label || ""}</label></span><b style='text-align:right;'>${getCurrencyPrefix(props.numberPrefix)}${item.value || ""}</b></div>`
|
|
50
50
|
};
|
|
51
|
-
}),
|
|
52
|
-
...
|
|
51
|
+
}), n = {
|
|
52
|
+
...N(e),
|
|
53
53
|
bgColor: e.bgColor || "#ffffff",
|
|
54
|
-
labelStep: p(
|
|
54
|
+
labelStep: p(G(e), e.labelStep),
|
|
55
55
|
xAxisName: e.xAxisName,
|
|
56
56
|
yAxisName: e.yAxisName,
|
|
57
57
|
chartBottomMargin: e.chartBottomMargin,
|
|
@@ -64,82 +64,82 @@ const M = (e = {}) => {
|
|
|
64
64
|
skipOverlapLabels: "0",
|
|
65
65
|
numberPrefix: y(e.numberPrefix),
|
|
66
66
|
// When per-item colors are set, don't use palettecolors (it overrides item colors)
|
|
67
|
-
palettecolors:
|
|
67
|
+
palettecolors: d ? void 0 : L(e.palettecolors),
|
|
68
68
|
maxLabelHeight: e.maxLabelHeight,
|
|
69
69
|
numbersuffix: e.numbersuffix || ""
|
|
70
|
-
},
|
|
71
|
-
chart:
|
|
72
|
-
categories:
|
|
73
|
-
dataset:
|
|
70
|
+
}, s = e.graphData, c = e?.hideScroll ? { chart: n, data: i?.length > 0 ? i : e?.graphData || [] } : {
|
|
71
|
+
chart: n,
|
|
72
|
+
categories: s?.categories,
|
|
73
|
+
dataset: s?.dataset
|
|
74
74
|
};
|
|
75
|
-
return
|
|
76
|
-
type:
|
|
75
|
+
return b({
|
|
76
|
+
type: M(e),
|
|
77
77
|
width: m,
|
|
78
78
|
height: e.height || "300",
|
|
79
79
|
dataSource: c
|
|
80
80
|
});
|
|
81
|
-
},
|
|
81
|
+
}, U = (e = {}) => b({
|
|
82
82
|
type: "area2d",
|
|
83
83
|
width: m,
|
|
84
84
|
height: "550",
|
|
85
85
|
dataSource: {
|
|
86
86
|
chart: {
|
|
87
|
-
...
|
|
87
|
+
...N({ ...e, decimals: "2" }),
|
|
88
88
|
xAxisName: e.xAxisName,
|
|
89
89
|
yAxisName: e.yAxisName,
|
|
90
90
|
labelFontSize: 12,
|
|
91
|
-
plotToolText: e.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2b2b2b;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#AAAAAA;'>$label</label><b style='text-align:right; color:#2b2b2b;font-weight:500;font-size:10px;'>${
|
|
91
|
+
plotToolText: e.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2b2b2b;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#AAAAAA;'>$label</label><b style='text-align:right; color:#2b2b2b;font-weight:500;font-size:10px;'>${E()}$value</b></div>`
|
|
92
92
|
// plotToolText: props.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$label</label><b style='text-align:right;'>${getCurrencySymbol()}$value</b></div>`,
|
|
93
93
|
},
|
|
94
94
|
data: e.graphData || []
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
97
|
-
const t = Array.isArray(e?.graphData) ? e.graphData : [],
|
|
98
|
-
...
|
|
99
|
-
toolText: e?.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${
|
|
96
|
+
}), K = (e = {}) => {
|
|
97
|
+
const t = Array.isArray(e?.graphData) ? e.graphData : [], l = y(e?.numberPrefix), d = (e?.palettecolors || "#8ECFFF").split(",")[0].trim(), a = t?.map((i) => ({
|
|
98
|
+
...i,
|
|
99
|
+
toolText: e?.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${i?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${d};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${i?.label || ""}</label></span><b style='text-align:right; color:#2B2B2B;font-weight:500;font-size:10px;'>${l}${i?.value || ""}</b></div>`
|
|
100
100
|
// toolText: props?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${item?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${lineColor};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${item?.label || ""}</label></span><b style='text-align:right;'>${numberPrefix}${item?.value || ""}</b></div>`
|
|
101
101
|
}));
|
|
102
|
-
return
|
|
102
|
+
return b({
|
|
103
103
|
type: "line",
|
|
104
104
|
width: e?.width || m,
|
|
105
105
|
height: e?.height || "300",
|
|
106
106
|
dataSource: {
|
|
107
107
|
chart: {
|
|
108
|
-
...
|
|
108
|
+
...j(e),
|
|
109
109
|
xAxisName: e?.xAxisName,
|
|
110
110
|
yAxisName: e?.yAxisName,
|
|
111
111
|
labelStep: p(t.length, void 0),
|
|
112
112
|
...e?.chartConfig || {}
|
|
113
113
|
},
|
|
114
|
-
data:
|
|
114
|
+
data: a.length > 0 ? a : e?.graphData || []
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
},
|
|
118
|
-
let t =
|
|
117
|
+
}, X = (e = {}) => {
|
|
118
|
+
let t = E();
|
|
119
119
|
e.numberPrefix === "" ? t = "" : e.numberPrefix !== null && e.numberPrefix !== void 0 && (t = e.numberPrefix);
|
|
120
|
-
const
|
|
121
|
-
const c =
|
|
122
|
-
const
|
|
123
|
-
return
|
|
120
|
+
const l = e.graphData, d = (l?.dataset || []).some((i) => !!i.color), a = (l?.dataset || []).map((i, n) => {
|
|
121
|
+
const c = i.data?.map((r) => {
|
|
122
|
+
const o = r.value;
|
|
123
|
+
return o == null || Number(o) === 0 || typeof o == "string" && o.trim() === "" ? { ...r, value: 0 } : r;
|
|
124
124
|
});
|
|
125
125
|
return {
|
|
126
|
-
...
|
|
126
|
+
...i,
|
|
127
127
|
...c ? { data: c } : {},
|
|
128
128
|
// plotToolText: props.plotToolText || (
|
|
129
129
|
// index === 0
|
|
130
130
|
// ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>"
|
|
131
131
|
// : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>"
|
|
132
|
-
plotToolText: e.plotToolText || (
|
|
132
|
+
plotToolText: e.plotToolText || (n === 0 ? "<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>$dataValue</b></div>" : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>$dataValue</b></div>")
|
|
133
133
|
};
|
|
134
134
|
});
|
|
135
|
-
return
|
|
135
|
+
return b({
|
|
136
136
|
type: "mscolumn2d",
|
|
137
137
|
key: e.key,
|
|
138
138
|
width: e.width || m,
|
|
139
139
|
height: e.height || "400",
|
|
140
140
|
dataSource: {
|
|
141
141
|
chart: {
|
|
142
|
-
...
|
|
142
|
+
...Y(e),
|
|
143
143
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
144
144
|
xAxisName: e.xAxisName,
|
|
145
145
|
yAxisName: e.yAxisName,
|
|
@@ -147,16 +147,16 @@ const M = (e = {}) => {
|
|
|
147
147
|
showLegend: "0",
|
|
148
148
|
legendIconSides: e.legendIconSides,
|
|
149
149
|
numberPrefix: t,
|
|
150
|
-
labelStep: p(
|
|
151
|
-
...
|
|
150
|
+
labelStep: p(l?.category?.length, e.labelStep),
|
|
151
|
+
...d ? { palettecolors: void 0 } : {}
|
|
152
152
|
},
|
|
153
|
-
categories: [{ category:
|
|
154
|
-
dataset:
|
|
153
|
+
categories: [{ category: l?.category || [] }],
|
|
154
|
+
dataset: a
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
},
|
|
158
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
159
|
-
...
|
|
157
|
+
}, q = (e = {}) => {
|
|
158
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, d = (l?.dataset || []).some((n) => !!n.color), a = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:500'>Total</span><b style='color:#2B2B2B;font-weight:500;font-size:10px;'>$sum</b></div>", i = (l?.dataset || []).map((n, s) => ({
|
|
159
|
+
...n,
|
|
160
160
|
// plotToolText: props.plotToolText || (plotToolText: props.plotToolText || (
|
|
161
161
|
// index === 0
|
|
162
162
|
// ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + totalRow
|
|
@@ -164,16 +164,16 @@ const M = (e = {}) => {
|
|
|
164
164
|
// index === 0
|
|
165
165
|
// ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + totalRow
|
|
166
166
|
// : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + totalRow
|
|
167
|
-
plotToolText: e.plotToolText || (
|
|
167
|
+
plotToolText: e.plotToolText || (s === 0 ? "<div style='font-size: 10px;font-weight:500;color:#2b2b2b;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2b2b2b;font-weight:500;font-size:10px;'>$dataValue</b></div>" + a : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373'>$seriesName</label><b style='text-align:right;color:#2b2b2b;font-weight:500;font-size:10px;'>$dataValue</b></div>" + a)
|
|
168
168
|
}));
|
|
169
|
-
return
|
|
169
|
+
return b({
|
|
170
170
|
type: e.hideScroll ? "stackedcolumn2d" : "scrollstackedcolumn2d",
|
|
171
171
|
key: e.key,
|
|
172
172
|
width: e.width || m,
|
|
173
173
|
height: e.height || "400",
|
|
174
174
|
dataSource: {
|
|
175
175
|
chart: {
|
|
176
|
-
...
|
|
176
|
+
...F(e),
|
|
177
177
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
178
178
|
xAxisName: e.xAxisName,
|
|
179
179
|
yAxisName: e.yAxisName,
|
|
@@ -182,20 +182,20 @@ const M = (e = {}) => {
|
|
|
182
182
|
interactiveLegend: e.interactiveLegend || "1",
|
|
183
183
|
drawCrossLine: e.drawCrossLine || "1",
|
|
184
184
|
bgColor: e.bgColor || "#ffffff",
|
|
185
|
-
palettecolors:
|
|
185
|
+
palettecolors: d ? void 0 : e.palettecolors || $,
|
|
186
186
|
numberPrefix: t,
|
|
187
|
-
labelStep: p(
|
|
187
|
+
labelStep: p(l?.category?.length, e.labelStep),
|
|
188
188
|
showSum: e.showSum ? "1" : void 0
|
|
189
189
|
},
|
|
190
190
|
categories: [
|
|
191
|
-
{ category:
|
|
191
|
+
{ category: l?.category || [] }
|
|
192
192
|
],
|
|
193
|
-
dataset:
|
|
193
|
+
dataset: i
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
},
|
|
197
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
198
|
-
...
|
|
196
|
+
}, J = (e = {}) => {
|
|
197
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, d = (l?.dataset || []).map((a, i) => ({
|
|
198
|
+
...a,
|
|
199
199
|
drawCustomLegendIcon: "1",
|
|
200
200
|
legendIconSides: "4",
|
|
201
201
|
legendIconBorderThickness: "0",
|
|
@@ -204,16 +204,16 @@ const M = (e = {}) => {
|
|
|
204
204
|
// index === 0
|
|
205
205
|
// ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>"
|
|
206
206
|
// : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>"
|
|
207
|
-
plotToolText: e.plotToolText || (
|
|
207
|
+
plotToolText: e.plotToolText || (i === 0 ? "<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>$dataValue</b></div>" : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;font-weight:500;font-size:10px;color:#2B2B2B;'>$dataValue</b></div>")
|
|
208
208
|
}));
|
|
209
|
-
return
|
|
209
|
+
return b({
|
|
210
210
|
type: "msline",
|
|
211
211
|
key: e.key,
|
|
212
212
|
width: e.width || m,
|
|
213
213
|
height: e.height || "400",
|
|
214
214
|
dataSource: {
|
|
215
215
|
chart: {
|
|
216
|
-
...
|
|
216
|
+
...R(e),
|
|
217
217
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
218
218
|
xAxisName: e.xAxisName,
|
|
219
219
|
yAxisName: e.yAxisName,
|
|
@@ -221,57 +221,57 @@ const M = (e = {}) => {
|
|
|
221
221
|
legendPosition: e.legendRight ? void 0 : e.legendPosition,
|
|
222
222
|
numberPrefix: t,
|
|
223
223
|
chartLeftMargin: e.chartLeftMargin || "20",
|
|
224
|
-
labelStep: p(
|
|
224
|
+
labelStep: p(l?.category?.length, e.labelStep),
|
|
225
225
|
showValues: e.showValues === "1" ? "1" : "0"
|
|
226
226
|
},
|
|
227
|
-
categories: [{ category:
|
|
228
|
-
dataset:
|
|
227
|
+
categories: [{ category: l?.category || [] }],
|
|
228
|
+
dataset: d
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
|
-
},
|
|
232
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
233
|
-
const
|
|
231
|
+
}, Q = (e = {}) => {
|
|
232
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, a = (e.palettecolors || I).split(",").map((c) => c.trim()), i = l?.category || [], n = l?.dataset || [], s = n.map((c, r) => {
|
|
233
|
+
const g = c.color || a[r % a.length], h = c.data || [];
|
|
234
234
|
return {
|
|
235
235
|
...c,
|
|
236
|
-
color:
|
|
237
|
-
plotBorderColor:
|
|
236
|
+
color: g,
|
|
237
|
+
plotBorderColor: g,
|
|
238
238
|
plotBorderThickness: "2",
|
|
239
239
|
plotBorderAlpha: "100",
|
|
240
|
-
anchorBgColor:
|
|
241
|
-
anchorBorderColor:
|
|
240
|
+
anchorBgColor: g,
|
|
241
|
+
anchorBorderColor: g,
|
|
242
242
|
showPlotBorder: "1",
|
|
243
243
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {},
|
|
244
|
-
data:
|
|
245
|
-
const
|
|
244
|
+
data: h.map((w, f) => {
|
|
245
|
+
const x = i[f]?.label || "";
|
|
246
246
|
if (e.plotToolText)
|
|
247
|
-
return { ...
|
|
248
|
-
if (
|
|
247
|
+
return { ...w, alpha: "60" };
|
|
248
|
+
if (r > 0)
|
|
249
249
|
return {
|
|
250
|
-
...
|
|
250
|
+
...w,
|
|
251
251
|
alpha: "60",
|
|
252
252
|
toolText: " "
|
|
253
253
|
};
|
|
254
|
-
const
|
|
255
|
-
const T = v.color ||
|
|
256
|
-
return `<div style='display:flex;justify-content:space-between;align-items:center;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px;color:#737373;'><span style='width:10px;height:10px;border-radius:2px;background-color:${T};display:inline-block'></span>${
|
|
254
|
+
const u = n.map((v, C) => {
|
|
255
|
+
const T = v.color || a[C % a.length], B = (v.data || [])[f]?.value ?? "", S = v.seriesname || "";
|
|
256
|
+
return `<div style='display:flex;justify-content:space-between;align-items:center;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px;color:#737373;'><span style='width:10px;height:10px;border-radius:2px;background-color:${T};display:inline-block'></span>${S}</span><b style='color:#2B2B2B;font-weight:500;font-size:10px;'>${t}${B}</b></div>`;
|
|
257
257
|
}).join("");
|
|
258
258
|
return {
|
|
259
|
-
...
|
|
259
|
+
...w,
|
|
260
260
|
alpha: "60",
|
|
261
261
|
// toolText: `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${label}</div>${tooltipItems}`,
|
|
262
|
-
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${
|
|
262
|
+
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${x}</div>${u}`
|
|
263
263
|
};
|
|
264
264
|
})
|
|
265
265
|
};
|
|
266
266
|
});
|
|
267
|
-
return
|
|
267
|
+
return b({
|
|
268
268
|
type: "stackedarea2d",
|
|
269
269
|
key: e.key,
|
|
270
270
|
width: e.width || m,
|
|
271
271
|
height: e.height || "400",
|
|
272
272
|
dataSource: {
|
|
273
273
|
chart: {
|
|
274
|
-
...
|
|
274
|
+
...H(e),
|
|
275
275
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
276
276
|
xAxisName: e.xAxisName,
|
|
277
277
|
yAxisName: e.yAxisName,
|
|
@@ -281,98 +281,98 @@ const M = (e = {}) => {
|
|
|
281
281
|
drawCrossLine: "1",
|
|
282
282
|
crossLineColor: "#f2f5fa",
|
|
283
283
|
numberPrefix: t,
|
|
284
|
-
labelStep: p(
|
|
284
|
+
labelStep: p(l?.category?.length, e.labelStep)
|
|
285
285
|
},
|
|
286
|
-
categories: [{ category:
|
|
287
|
-
dataset:
|
|
286
|
+
categories: [{ category: l?.category || [] }],
|
|
287
|
+
dataset: s
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
|
-
},
|
|
291
|
-
const t = y(e.numberPrefix),
|
|
290
|
+
}, Z = (e = {}) => {
|
|
291
|
+
const t = y(e.numberPrefix), d = (e?.palettecolors || "#8ECFFF").split(",").map((o) => o.trim()), a = d[0];
|
|
292
292
|
if (!Array.isArray(e?.graphData) && e?.graphData?.dataset) {
|
|
293
|
-
const
|
|
294
|
-
const
|
|
293
|
+
const o = e.graphData, g = o?.category || [], h = o?.dataset || [], w = h.map((f, x) => {
|
|
294
|
+
const u = f.color || d[x % d.length], v = f.data || [];
|
|
295
295
|
return {
|
|
296
|
-
...
|
|
297
|
-
color:
|
|
296
|
+
...f,
|
|
297
|
+
color: u,
|
|
298
298
|
anchorRadius: "3",
|
|
299
299
|
anchorBgColor: "#FFFFFF",
|
|
300
|
-
anchorBorderColor:
|
|
300
|
+
anchorBorderColor: u,
|
|
301
301
|
anchorBorderThickness: "1",
|
|
302
302
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {},
|
|
303
303
|
data: v.map((C, T) => {
|
|
304
|
-
const
|
|
304
|
+
const D = g[T]?.label || "";
|
|
305
305
|
if (e.plotToolText)
|
|
306
306
|
return { ...C };
|
|
307
|
-
const B = x
|
|
308
|
-
return
|
|
307
|
+
const B = h[x]?.seriesname || "", S = (h[x]?.data || [])[T]?.value ?? "", k = f.color || d[x % d.length], P = `<div class='scroll-area-tooltip-row' data-series-index='${x}' style='display:flex;align-items:center;gap:5px;padding:2px 0;min-width:200px'><span class='scroll-area-dot' style='width:8px;height:8px;border-radius:2px;background-color:${k};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${B}</label><b style='text-align:right;margin-left:auto;color:#2B2B2B;font-weight:500;font-size:10px;'>${t}${S}</b></div>`;
|
|
308
|
+
return x === 0 ? {
|
|
309
309
|
...C,
|
|
310
310
|
// toolText: `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${label}</div>${row}`,
|
|
311
|
-
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${
|
|
311
|
+
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${D}</div>${P}`
|
|
312
312
|
} : {
|
|
313
313
|
...C,
|
|
314
|
-
toolText:
|
|
314
|
+
toolText: P
|
|
315
315
|
};
|
|
316
316
|
})
|
|
317
317
|
};
|
|
318
318
|
});
|
|
319
|
-
return
|
|
319
|
+
return b({
|
|
320
320
|
type: "scrollarea2d",
|
|
321
321
|
width: e?.width || m,
|
|
322
322
|
height: e?.height || "400",
|
|
323
323
|
dataSource: {
|
|
324
324
|
chart: {
|
|
325
|
-
...
|
|
325
|
+
...V(e),
|
|
326
326
|
xAxisName: e?.xAxisName,
|
|
327
327
|
yAxisName: e?.yAxisName,
|
|
328
328
|
numberPrefix: t,
|
|
329
329
|
...e?.chartConfig || {}
|
|
330
330
|
},
|
|
331
|
-
categories: [{ category:
|
|
332
|
-
dataset:
|
|
331
|
+
categories: [{ category: g }],
|
|
332
|
+
dataset: w
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
value:
|
|
336
|
+
const n = Array.isArray(e?.graphData) ? e.graphData : [], s = n.map((o) => ({ label: o?.label || "" })), c = e.legendLabel || "Spend", r = n.map((o) => ({
|
|
337
|
+
value: o?.value,
|
|
338
338
|
// toolText: props?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${item?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${lineColor};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${seriesName}</label></span><b style='text-align:right;'>${numberPrefix}${item?.value || ""}</b></div>`,
|
|
339
|
-
toolText: e?.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${
|
|
339
|
+
toolText: e?.plotToolText || `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${o?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px'><span style='width:8px;height:8px;border-radius:2px;background-color:${a};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${c}</label></span><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${t}${o?.value || ""}</b></div>`
|
|
340
340
|
}));
|
|
341
|
-
return
|
|
341
|
+
return b({
|
|
342
342
|
type: "scrollarea2d",
|
|
343
343
|
width: e?.width || m,
|
|
344
344
|
height: e?.height || "400",
|
|
345
345
|
dataSource: {
|
|
346
346
|
chart: {
|
|
347
|
-
...
|
|
347
|
+
...V(e),
|
|
348
348
|
xAxisName: e?.xAxisName,
|
|
349
349
|
yAxisName: e?.yAxisName,
|
|
350
350
|
numberPrefix: t,
|
|
351
351
|
...e?.chartConfig || {}
|
|
352
352
|
},
|
|
353
|
-
categories: [{ category:
|
|
353
|
+
categories: [{ category: s }],
|
|
354
354
|
dataset: [
|
|
355
355
|
{
|
|
356
356
|
seriesname: c,
|
|
357
|
-
color:
|
|
357
|
+
color: a,
|
|
358
358
|
anchorRadius: "3",
|
|
359
359
|
anchorBgColor: "#FFFFFF",
|
|
360
|
-
anchorBorderColor:
|
|
360
|
+
anchorBorderColor: a,
|
|
361
361
|
anchorBorderThickness: "1",
|
|
362
|
-
data:
|
|
362
|
+
data: r
|
|
363
363
|
}
|
|
364
364
|
]
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
|
-
},
|
|
367
|
+
}, ee = (e = {}) => {
|
|
368
368
|
const t = e.graphData;
|
|
369
|
-
return
|
|
369
|
+
return b({
|
|
370
370
|
type: "stackedbar2d",
|
|
371
371
|
width: m,
|
|
372
372
|
height: e.height || "400",
|
|
373
373
|
dataSource: {
|
|
374
374
|
chart: {
|
|
375
|
-
...
|
|
375
|
+
...O(e),
|
|
376
376
|
xAxisName: e.xAxisName,
|
|
377
377
|
yAxisName: e.yAxisName,
|
|
378
378
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {}
|
|
@@ -381,9 +381,9 @@ const M = (e = {}) => {
|
|
|
381
381
|
dataset: t?.dataset || []
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
|
-
},
|
|
384
|
+
}, te = (e = {}) => {
|
|
385
385
|
const t = e.graphData;
|
|
386
|
-
return
|
|
386
|
+
return b({
|
|
387
387
|
type: "sankey",
|
|
388
388
|
width: m,
|
|
389
389
|
height: e.height || "600",
|
|
@@ -413,36 +413,36 @@ const M = (e = {}) => {
|
|
|
413
413
|
links: t?.links || []
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
|
-
},
|
|
417
|
-
const
|
|
418
|
-
if (!
|
|
419
|
-
|
|
420
|
-
else if (
|
|
421
|
-
const [
|
|
422
|
-
|
|
416
|
+
}, ae = (e = {}) => {
|
|
417
|
+
const l = e.graphData?.data || [], d = l.reduce((o, g) => o + (Number(g.value) || 0), 0), a = Math.round(d * 100) / 100, i = e.numberPrefix ?? "$", n = { ...e }, s = e?.formateLargeAmount;
|
|
418
|
+
if (!n.defaultCenterLabel)
|
|
419
|
+
n.defaultCenterLabel = s ? `Total{br}${A(a, i)}` : `Total{br}${i}${a}`;
|
|
420
|
+
else if (n.defaultCenterLabel.includes("{br}")) {
|
|
421
|
+
const [o] = n.defaultCenterLabel.split("{br}");
|
|
422
|
+
n.defaultCenterLabel = s ? `${o}{br}${A(a, i)}` : `${o}{br}${i}${a}`;
|
|
423
423
|
}
|
|
424
|
-
const
|
|
425
|
-
const h = Number(
|
|
426
|
-
let
|
|
427
|
-
return
|
|
428
|
-
...
|
|
429
|
-
color:
|
|
430
|
-
displayValue: `${
|
|
431
|
-
toolText:
|
|
424
|
+
const c = (e.palettecolors || $).split(",").map((o) => o.trim()), r = l.map((o, g) => {
|
|
425
|
+
const h = Number(o.value) || 0, w = a > 0 ? (h / a * 100).toFixed(2) : "0", f = o.color || c[g % c.length];
|
|
426
|
+
let x;
|
|
427
|
+
return o.toolText ? x = o.toolText : e.plotToolText ? x = e.plotToolText : x = `<div style='font-size: 10px;font-weight:500;color:#2b2b2b;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${o.label}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;font-size: 10px;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373'><span style='width:8px;height:8px;border-radius:2px;background-color:${f};display:inline-block;margin-right:5px;color:#AAAAAA;'></span>${o.label}</label><b style='text-align:right;color:#2b2b2b;font-weight:500;font-size:10px;'>${s ? A(h, i) : i + "" + h}</b></div>`, x = x.replace(/\$plotFillColor/g, f).replace(/\$color/g, f).replace(/\$label/g, o.label || "").replace(/\$value/g, String(o.value ?? "")).replace(/\$dataValue/g, s ? A(h, i) : `${i}${h}`).replace(/\$percentValue/g, w).replace(/\$unformattedSum/g, String(a)).replace(/\$sum/g, s ? A(a, i) : `${i}${a}`), {
|
|
428
|
+
...o,
|
|
429
|
+
color: f,
|
|
430
|
+
displayValue: `${s ? A(h, i) : i + "" + o.value} (${w}%){br}${o.label}`,
|
|
431
|
+
toolText: x
|
|
432
432
|
};
|
|
433
433
|
});
|
|
434
|
-
return
|
|
434
|
+
return b({
|
|
435
435
|
type: "doughnut2d",
|
|
436
436
|
width: e.width || "136",
|
|
437
437
|
height: e.height || "136",
|
|
438
438
|
dataSource: {
|
|
439
|
-
chart:
|
|
440
|
-
data:
|
|
439
|
+
chart: _(n),
|
|
440
|
+
data: r
|
|
441
441
|
}
|
|
442
442
|
});
|
|
443
|
-
},
|
|
443
|
+
}, le = (e = {}) => {
|
|
444
444
|
const t = e.graphData;
|
|
445
|
-
return
|
|
445
|
+
return b({
|
|
446
446
|
type: "multiaxisline",
|
|
447
447
|
key: e.key,
|
|
448
448
|
width: e.width || m,
|
|
@@ -453,9 +453,9 @@ const M = (e = {}) => {
|
|
|
453
453
|
axis: t?.axis || []
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
|
-
},
|
|
456
|
+
}, oe = (e = {}) => {
|
|
457
457
|
const t = e.graphData;
|
|
458
|
-
return
|
|
458
|
+
return b({
|
|
459
459
|
type: "multilevelpie",
|
|
460
460
|
width: e.width || "550",
|
|
461
461
|
height: e.height || "350",
|
|
@@ -464,26 +464,26 @@ const M = (e = {}) => {
|
|
|
464
464
|
category: t?.data?.category
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
|
-
},
|
|
468
|
-
let t = [],
|
|
467
|
+
}, ie = (e = {}) => {
|
|
468
|
+
let t = [], l = [];
|
|
469
469
|
if (Array.isArray(e.graphData)) {
|
|
470
|
-
const
|
|
471
|
-
t =
|
|
470
|
+
const n = e.graphData;
|
|
471
|
+
t = n.map((s) => ({ label: s.label || "" })), l = [
|
|
472
472
|
{
|
|
473
473
|
seriesname: "Series 1",
|
|
474
|
-
data:
|
|
474
|
+
data: n.map((s) => ({ value: s.value }))
|
|
475
475
|
}
|
|
476
476
|
];
|
|
477
477
|
} else {
|
|
478
|
-
const
|
|
479
|
-
t =
|
|
480
|
-
...
|
|
481
|
-
seriesname:
|
|
482
|
-
data:
|
|
478
|
+
const n = e.graphData;
|
|
479
|
+
t = n?.category || [], l = (n?.dataset || []).map((s) => ({
|
|
480
|
+
...s,
|
|
481
|
+
seriesname: s.seriesname || "Series",
|
|
482
|
+
data: s.data || []
|
|
483
483
|
}));
|
|
484
484
|
}
|
|
485
|
-
const
|
|
486
|
-
...
|
|
485
|
+
const d = y(e.numberPrefix), a = l.some((n) => !!n.color), i = {
|
|
486
|
+
...N(e),
|
|
487
487
|
bgColor: e.bgColor || "#ffffff",
|
|
488
488
|
xAxisName: e.xAxisName,
|
|
489
489
|
yAxisName: e.yAxisName,
|
|
@@ -496,9 +496,9 @@ const M = (e = {}) => {
|
|
|
496
496
|
showLabels: e.showLabels || "1",
|
|
497
497
|
showLegend: "0",
|
|
498
498
|
skipOverlapLabels: "0",
|
|
499
|
-
numberPrefix:
|
|
499
|
+
numberPrefix: d,
|
|
500
500
|
numVDivLines: e.numVDivLines || "5",
|
|
501
|
-
palettecolors:
|
|
501
|
+
palettecolors: a ? void 0 : L(e.palettecolors),
|
|
502
502
|
maxLabelHeight: e.maxLabelHeight,
|
|
503
503
|
numbersuffix: e.numbersuffix || "",
|
|
504
504
|
labelStep: p(t.length, e.labelStep),
|
|
@@ -510,33 +510,33 @@ const M = (e = {}) => {
|
|
|
510
510
|
scrollPadding: "5",
|
|
511
511
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {}
|
|
512
512
|
};
|
|
513
|
-
return
|
|
513
|
+
return b({
|
|
514
514
|
type: "scrollcolumn2d",
|
|
515
515
|
width: e.width || m,
|
|
516
516
|
height: e.height || "400",
|
|
517
517
|
dataSource: {
|
|
518
|
-
chart:
|
|
518
|
+
chart: i,
|
|
519
519
|
categories: [{ category: t }],
|
|
520
|
-
dataset:
|
|
520
|
+
dataset: l
|
|
521
521
|
}
|
|
522
522
|
});
|
|
523
|
-
},
|
|
524
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
525
|
-
...
|
|
523
|
+
}, ne = (e = {}) => {
|
|
524
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, d = (l?.dataset || []).some((n) => !!n.color), a = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:500'>Total</span><b style='color:#2B2B2B;font-weight:500;font-size:10px'>$sum</b></div>", i = (l?.dataset || []).map((n, s) => ({
|
|
525
|
+
...n,
|
|
526
526
|
// plotToolText: props.plotToolText || (
|
|
527
527
|
// index === 0
|
|
528
528
|
// ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + totalRow
|
|
529
529
|
// : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + totalRow
|
|
530
|
-
plotToolText: e.plotToolText || (
|
|
530
|
+
plotToolText: e.plotToolText || (s === 0 ? "<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>$dataValue</b></div>" + a : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>$seriesName</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>$dataValue</b></div>" + a)
|
|
531
531
|
}));
|
|
532
|
-
return
|
|
532
|
+
return b({
|
|
533
533
|
type: "scrollstackedcolumn2d",
|
|
534
534
|
key: e.key,
|
|
535
535
|
width: e.width || m,
|
|
536
536
|
height: e.height || "400",
|
|
537
537
|
dataSource: {
|
|
538
538
|
chart: {
|
|
539
|
-
...
|
|
539
|
+
...F(e),
|
|
540
540
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
541
541
|
xAxisName: e.xAxisName,
|
|
542
542
|
yAxisName: e.yAxisName,
|
|
@@ -545,10 +545,10 @@ const M = (e = {}) => {
|
|
|
545
545
|
interactiveLegend: e.interactiveLegend || "1",
|
|
546
546
|
drawCrossLine: e.drawCrossLine || "1",
|
|
547
547
|
bgColor: e.bgColor || "#ffffff",
|
|
548
|
-
palettecolors:
|
|
548
|
+
palettecolors: d ? void 0 : e.palettecolors || $,
|
|
549
549
|
numberPrefix: t,
|
|
550
550
|
numVDivLines: e.numVDivLines || "5",
|
|
551
|
-
labelStep: p(
|
|
551
|
+
labelStep: p(l?.category?.length, e.labelStep),
|
|
552
552
|
showSum: e.showSum ? "1" : void 0,
|
|
553
553
|
numVisiblePlot: e.numVisiblePlot || "6",
|
|
554
554
|
scrollShowButtons: "0",
|
|
@@ -557,65 +557,65 @@ const M = (e = {}) => {
|
|
|
557
557
|
flatScrollBars: "1",
|
|
558
558
|
scrollPadding: "5"
|
|
559
559
|
},
|
|
560
|
-
categories: [{ category:
|
|
561
|
-
dataset:
|
|
560
|
+
categories: [{ category: l?.category || [] }],
|
|
561
|
+
dataset: i
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
-
},
|
|
565
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
566
|
-
const
|
|
564
|
+
}, se = (e = {}) => {
|
|
565
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, d = (l?.dataset || []).some((c) => !!c.color), a = (e.palettecolors || $).split(",").map((c) => c.trim()), i = l?.category || [], n = l?.dataset || [], s = n.map((c, r) => {
|
|
566
|
+
const o = c.color || a[r % a.length], g = c.data || [];
|
|
567
567
|
return {
|
|
568
568
|
...c,
|
|
569
|
-
color:
|
|
569
|
+
color: o,
|
|
570
570
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {},
|
|
571
|
-
data:
|
|
572
|
-
const
|
|
571
|
+
data: g.map((h, w) => {
|
|
572
|
+
const f = i[w]?.label || "";
|
|
573
573
|
if (e.plotToolText)
|
|
574
|
-
return { ...
|
|
575
|
-
if (
|
|
576
|
-
return { ...
|
|
577
|
-
const
|
|
578
|
-
const C =
|
|
579
|
-
return `<div class='mscombi-tooltip-row' data-series-index='${v}' data-render-as='${k}' style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'><span class='mscombi-dot' style='width:8px;height:8px;border-radius:2px;background-color:${C};display:inline-block;margin-right:5px;'></span>${B}</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${
|
|
574
|
+
return { ...h };
|
|
575
|
+
if (r > 0)
|
|
576
|
+
return { ...h, toolText: " " };
|
|
577
|
+
const x = n.map((u, v) => {
|
|
578
|
+
const C = u.color || a[v % a.length], D = (u.data || [])[w]?.value ?? "", B = u.seriesname || "", S = u.tooltipPrefix !== void 0 ? u.tooltipPrefix : t, k = u.renderAs || "column";
|
|
579
|
+
return `<div class='mscombi-tooltip-row' data-series-index='${v}' data-render-as='${k}' style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'><span class='mscombi-dot' style='width:8px;height:8px;border-radius:2px;background-color:${C};display:inline-block;margin-right:5px;'></span>${B}</label><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${S}${D}</b></div>`;
|
|
580
580
|
}).join("");
|
|
581
581
|
return {
|
|
582
|
-
...
|
|
582
|
+
...h,
|
|
583
583
|
// toolText: `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${label}</div>${tooltipItems}`,
|
|
584
|
-
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${
|
|
584
|
+
toolText: `<div style='font-size: 10px;font-weight:500;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${f}</div>${x}`
|
|
585
585
|
};
|
|
586
586
|
})
|
|
587
587
|
};
|
|
588
588
|
});
|
|
589
|
-
return
|
|
589
|
+
return b({
|
|
590
590
|
type: "mscombidy2d",
|
|
591
591
|
key: e.key,
|
|
592
592
|
width: e.width || m,
|
|
593
593
|
height: e.height || "400",
|
|
594
594
|
dataSource: {
|
|
595
595
|
chart: {
|
|
596
|
-
...
|
|
596
|
+
...W(e),
|
|
597
597
|
yAxisMaxValue: e.yAxisMaxValue,
|
|
598
598
|
xAxisName: e.xAxisName,
|
|
599
599
|
yAxisName: e.yAxisName,
|
|
600
600
|
pYAxisName: e.pYAxisName,
|
|
601
601
|
sYAxisName: e.sYAxisName,
|
|
602
602
|
numberPrefix: t,
|
|
603
|
-
labelStep: p(
|
|
604
|
-
palettecolors:
|
|
603
|
+
labelStep: p(i.length, e.labelStep),
|
|
604
|
+
palettecolors: d ? void 0 : e.palettecolors || $
|
|
605
605
|
},
|
|
606
|
-
categories: [{ category:
|
|
607
|
-
dataset:
|
|
606
|
+
categories: [{ category: i }],
|
|
607
|
+
dataset: s
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
|
-
},
|
|
611
|
-
const t = e.graphLabel ? "" : y(e.numberPrefix),
|
|
612
|
-
return
|
|
610
|
+
}, re = (e = {}) => {
|
|
611
|
+
const t = e.graphLabel ? "" : y(e.numberPrefix), l = e.graphData, d = l?.category || [], a = l?.dataset || [];
|
|
612
|
+
return b({
|
|
613
613
|
type: "scrollline2d",
|
|
614
614
|
width: e?.width || m,
|
|
615
615
|
height: e?.height || "400",
|
|
616
616
|
dataSource: {
|
|
617
617
|
chart: {
|
|
618
|
-
...
|
|
618
|
+
...j(e),
|
|
619
619
|
xAxisName: e?.xAxisName,
|
|
620
620
|
yAxisName: e?.yAxisName,
|
|
621
621
|
numberPrefix: t,
|
|
@@ -629,34 +629,34 @@ const M = (e = {}) => {
|
|
|
629
629
|
flatScrollBars: "1",
|
|
630
630
|
scrollPadding: "5",
|
|
631
631
|
numDivLines: "5",
|
|
632
|
-
labelStep: p(
|
|
632
|
+
labelStep: p(d.length, e?.labelStep),
|
|
633
633
|
...e?.plotToolText ? { plotToolText: e.plotToolText } : {},
|
|
634
634
|
...e?.chartConfig || {}
|
|
635
635
|
},
|
|
636
|
-
categories: [{ category:
|
|
637
|
-
dataset:
|
|
636
|
+
categories: [{ category: d }],
|
|
637
|
+
dataset: a
|
|
638
638
|
}
|
|
639
639
|
});
|
|
640
|
-
},
|
|
641
|
-
area:
|
|
642
|
-
bar2d:
|
|
643
|
-
column2d:
|
|
644
|
-
doughnutChart:
|
|
645
|
-
groupChart:
|
|
646
|
-
line:
|
|
647
|
-
msCombiDy2d:
|
|
648
|
-
multiAxisLineChart:
|
|
649
|
-
multilevelpie:
|
|
650
|
-
multipleLineChart:
|
|
651
|
-
sankey:
|
|
652
|
-
scrollArea:
|
|
653
|
-
scrollColumn2d:
|
|
654
|
-
scrollLine2d:
|
|
655
|
-
scrollStackedColumn2d:
|
|
656
|
-
stackBarChart:
|
|
657
|
-
stackedArea:
|
|
658
|
-
stackedcolumn2d:
|
|
659
|
-
},
|
|
640
|
+
}, de = {
|
|
641
|
+
area: U,
|
|
642
|
+
bar2d: z,
|
|
643
|
+
column2d: z,
|
|
644
|
+
doughnutChart: ae,
|
|
645
|
+
groupChart: X,
|
|
646
|
+
line: K,
|
|
647
|
+
msCombiDy2d: se,
|
|
648
|
+
multiAxisLineChart: le,
|
|
649
|
+
multilevelpie: oe,
|
|
650
|
+
multipleLineChart: J,
|
|
651
|
+
sankey: te,
|
|
652
|
+
scrollArea: Z,
|
|
653
|
+
scrollColumn2d: ie,
|
|
654
|
+
scrollLine2d: re,
|
|
655
|
+
scrollStackedColumn2d: ne,
|
|
656
|
+
stackBarChart: ee,
|
|
657
|
+
stackedArea: Q,
|
|
658
|
+
stackedcolumn2d: q
|
|
659
|
+
}, xe = (e = {}) => e.chartType ? de[e.chartType]?.(e) ?? null : null;
|
|
660
660
|
export {
|
|
661
|
-
|
|
661
|
+
xe as buildChartConfig
|
|
662
662
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doughnutHelper.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_helpers/doughnutHelper.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,WAAW,CAAC;QACxB,kBAAkB,CAAC,EAAE;YACnB,KAAK,CAAC,EAAE;gBAAE,YAAY,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YAClC,IAAI,CAAC,EAAE,KAAK,CAAC;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;SACjD,CAAC;KACH,CAAC;CACH;
|
|
1
|
+
{"version":3,"file":"doughnutHelper.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_helpers/doughnutHelper.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,WAAW,CAAC;QACxB,kBAAkB,CAAC,EAAE;YACnB,KAAK,CAAC,EAAE;gBAAE,YAAY,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YAClC,IAAI,CAAC,EAAE,KAAK,CAAC;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAC;gBAAC,KAAK,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;SACjD,CAAC;KACH,CAAC;CACH;AAsKD,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,gBAAqB,GAAG,IAAI,CAkKxE"}
|
|
@@ -1,80 +1,119 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
function v(i, b) {
|
|
2
|
+
if (i.length < 2) return;
|
|
3
|
+
const h = [], o = [];
|
|
4
|
+
i.forEach((t) => {
|
|
5
|
+
t.x < b ? h.push(t) : o.push(t);
|
|
6
|
+
}), E(h), E(o);
|
|
7
|
+
}
|
|
8
|
+
function E(i) {
|
|
9
|
+
if (i.length < 2) return;
|
|
10
|
+
i.sort((t, n) => t.originalY - n.originalY);
|
|
11
|
+
for (let t = 1; t < i.length; t++) {
|
|
12
|
+
const n = i[t - 1], l = i[t], c = 54;
|
|
13
|
+
if (Math.abs(n.x - l.x) > 100) continue;
|
|
14
|
+
l.y - n.y < c && (l.y = n.y + c);
|
|
15
|
+
}
|
|
16
|
+
const b = i.reduce((t, n) => t + n.originalY, 0) / i.length, o = i.reduce((t, n) => t + n.y, 0) / i.length - b;
|
|
17
|
+
if (o > 10) {
|
|
18
|
+
const t = Math.min(o * 0.5, i[0].y - i[0].originalY);
|
|
19
|
+
t > 0 && i.forEach((n) => {
|
|
20
|
+
n.y -= t;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
i.forEach((t) => {
|
|
24
|
+
const n = t.y - t.originalY;
|
|
25
|
+
if (Math.abs(n) < 1) return;
|
|
26
|
+
t.el.setAttribute("y", String(t.y));
|
|
27
|
+
const l = t.el.querySelectorAll("tspan");
|
|
28
|
+
if (l.length > 0) {
|
|
29
|
+
const c = l[0], f = c.getAttribute("y");
|
|
30
|
+
f && c.setAttribute("y", String(parseFloat(f) + n));
|
|
31
|
+
}
|
|
32
|
+
t.connectorPath && t.originalD && I(t.connectorPath, t.originalD, n);
|
|
7
33
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
34
|
+
}
|
|
35
|
+
function I(i, b, h) {
|
|
36
|
+
const o = /(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)/g, t = [];
|
|
37
|
+
let n;
|
|
38
|
+
for (; (n = o.exec(b)) !== null; )
|
|
39
|
+
t.push({
|
|
40
|
+
x: n[1],
|
|
41
|
+
y: n[2],
|
|
42
|
+
index: n.index,
|
|
43
|
+
length: n[0].length
|
|
44
|
+
});
|
|
45
|
+
if (t.length < 2) return;
|
|
46
|
+
let l = b;
|
|
47
|
+
for (let c = t.length - 1; c >= 1; c--) {
|
|
48
|
+
const f = t[c], m = parseFloat(f.y) + h, y = `${f.x},${m}`;
|
|
49
|
+
l = l.substring(0, f.index) + y + l.substring(f.index + f.length);
|
|
50
|
+
}
|
|
51
|
+
i.setAttribute("d", l);
|
|
52
|
+
}
|
|
53
|
+
function T(i = {}) {
|
|
54
|
+
const b = i?.sender?.container;
|
|
55
|
+
if (!b) return;
|
|
56
|
+
const h = i?.sender?.originalDataSource?.data || [], o = i?.sender?.originalDataSource?.chart?.numberPrefix || "", t = h.reduce((s, r) => s + (Number(r.value) || 0), 0), n = {};
|
|
57
|
+
h.forEach((s) => {
|
|
58
|
+
s.label && (n[s.label] = { value: s.value, label: s.label });
|
|
59
|
+
});
|
|
60
|
+
const l = new Set(h.map((s) => s.label).filter(Boolean)), c = b.querySelector("svg"), f = c ? parseFloat(c.getAttribute("width") || String(c.getBoundingClientRect().width)) / 2 : 300, m = Array.from(b.querySelectorAll("text")), y = [];
|
|
61
|
+
m.forEach((s) => {
|
|
62
|
+
const r = s, a = r?.textContent?.trim() || "";
|
|
63
|
+
if (n[a] || a.length === 0) return;
|
|
64
|
+
const A = String(t);
|
|
65
|
+
if (h.some((u) => {
|
|
66
|
+
const e = Number(u.value) || 0, d = t > 0 ? (e / t * 100).toFixed(2) : "0", x = `${o}${u.value} (${d}%)`;
|
|
67
|
+
return a.includes(x) || u.label && a.includes(u.label) && a.includes(o);
|
|
16
68
|
})) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
69
|
+
y.push(r);
|
|
70
|
+
const u = r.querySelectorAll("tspan");
|
|
71
|
+
u.length > 0 ? u.forEach((e, d) => {
|
|
72
|
+
const x = e.textContent?.trim() || "";
|
|
73
|
+
if (e.setAttribute("font-family", "Inter, sans-serif"), d === 0 || !l.has(x) && x.includes(o)) {
|
|
74
|
+
const w = x.match(/^(.+?)(\s*\(\d+\.\d+%\))$/);
|
|
75
|
+
if (w) {
|
|
76
|
+
const B = w[1], L = w[2];
|
|
77
|
+
e.textContent = "", e.setAttribute("font-size", "10"), e.setAttribute("fill", "#2B2B2B"), e.setAttribute("font-weight", "600");
|
|
78
|
+
const S = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
79
|
+
S.textContent = L, S.setAttribute("font-weight", "400"), e.appendChild(document.createTextNode(B)), e.appendChild(S);
|
|
27
80
|
} else
|
|
28
|
-
|
|
81
|
+
e.setAttribute("font-weight", "600"), e.setAttribute("font-size", "10"), e.setAttribute("fill", "#2b2b2b");
|
|
29
82
|
} else
|
|
30
|
-
|
|
31
|
-
}) : (
|
|
83
|
+
e.setAttribute("font-weight", "400"), e.setAttribute("font-size", "10"), e.setAttribute("fill", "#737373"), d === 1 && e.setAttribute("dy", "16");
|
|
84
|
+
}) : (r.setAttribute("font-family", "Inter, sans-serif"), r.setAttribute("font-weight", "700"), r.setAttribute("fill", "#2b2b2b"));
|
|
32
85
|
return;
|
|
33
86
|
}
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
}) : (
|
|
87
|
+
if (a.includes(A) || a.includes("Total") || a.includes("Resource")) {
|
|
88
|
+
const u = r.querySelectorAll("tspan");
|
|
89
|
+
u.length > 0 ? u.forEach((e) => {
|
|
90
|
+
const d = e.textContent?.trim() || "";
|
|
91
|
+
e.setAttribute("font-family", "Inter, sans-serif"), d === A || d === `${o}${t}` ? (e.setAttribute("font-weight", "600"), e.setAttribute("font-size", "11"), e.setAttribute("fill", "#2B2B2B"), e.setAttribute("dy", "16")) : (e.setAttribute("font-weight", "400"), e.setAttribute("font-size", "10"), e.setAttribute("fill", "#737373"));
|
|
92
|
+
}) : (r.setAttribute("font-family", "Inter, sans-serif"), a === A || a === `${o}${t}` ? (r.setAttribute("font-weight", "600"), r.setAttribute("font-size", "11"), r.setAttribute("fill", "#2B2B2B")) : (r.setAttribute("font-weight", "400"), r.setAttribute("font-size", "10"), r.setAttribute("fill", "#737373")));
|
|
40
93
|
}
|
|
41
94
|
});
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
x[n] && p.push(e);
|
|
50
|
-
});
|
|
51
|
-
const S = [];
|
|
52
|
-
p.forEach((e) => {
|
|
53
|
-
const n = parseFloat(e?.getAttribute?.("x") || "0"), o = parseFloat(e?.getAttribute?.("y") || "0"), a = e?.textContent?.trim?.() || "", w = S?.findIndex?.(
|
|
54
|
-
(s) => Math.abs(s.x - n) < 40 && Math.abs(s.y - o) < 50
|
|
55
|
-
);
|
|
56
|
-
if (w !== -1) {
|
|
57
|
-
const s = S?.[w], t = s?.el, i = y?.[a] || 9999, l = y?.[s.text] || 9999;
|
|
58
|
-
let r;
|
|
59
|
-
i === 2 ? r = e : l === 2 ? r = t : r = i > l ? e : t;
|
|
60
|
-
const v = parseFloat(r?.getAttribute?.("y") || "0") + $;
|
|
61
|
-
r?.setAttribute?.("y", String(v));
|
|
62
|
-
const u = r?.nextElementSibling;
|
|
63
|
-
if (u && u?.tagName === "path") {
|
|
64
|
-
const c = (u?.getAttribute?.("d") || "")?.match?.(/(-?\d+(\.\d+)?,-?\d+(\.\d+)?)/g);
|
|
65
|
-
if (c && c?.length >= 2) {
|
|
66
|
-
for (let d = 1; d < c?.length; d += 1) {
|
|
67
|
-
const C = c[d].split(","), I = C[0], L = parseFloat(C[1]) + $;
|
|
68
|
-
c[d] = `${I},${L}`;
|
|
69
|
-
}
|
|
70
|
-
const z = `M${c?.[0]}L${c?.slice?.(1)?.join?.(",")}`;
|
|
71
|
-
u?.setAttribute?.("d", z);
|
|
72
|
-
}
|
|
95
|
+
const C = y.map((s) => {
|
|
96
|
+
const r = parseFloat(s.getAttribute("x") || "0"), a = parseFloat(s.getAttribute("y") || "0");
|
|
97
|
+
let A = null, g = s.nextElementSibling;
|
|
98
|
+
for (let u = 0; u < 3 && g; u++) {
|
|
99
|
+
if (g.tagName === "path") {
|
|
100
|
+
A = g;
|
|
101
|
+
break;
|
|
73
102
|
}
|
|
103
|
+
g = g.nextElementSibling;
|
|
74
104
|
}
|
|
75
|
-
|
|
105
|
+
return {
|
|
106
|
+
el: s,
|
|
107
|
+
originalY: a,
|
|
108
|
+
y: a,
|
|
109
|
+
x: r,
|
|
110
|
+
connectorPath: A,
|
|
111
|
+
originalD: A?.getAttribute("d") || "",
|
|
112
|
+
text: s.textContent?.trim() || ""
|
|
113
|
+
};
|
|
76
114
|
});
|
|
115
|
+
v(C, f);
|
|
77
116
|
}
|
|
78
117
|
export {
|
|
79
|
-
|
|
118
|
+
T as adjustDoughnutLabels
|
|
80
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fusionChart.types.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_types/fusionChart.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,OAAO,GACP,UAAU,GACV,eAAe,GACf,YAAY,GACZ,MAAM,GACN,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,mBAAmB,GACnB,QAAQ,GACR,YAAY,GACZ,gBAAgB,GAChB,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,aAAa,GACb,iB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AC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"fusionChart.types.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_types/fusionChart.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,OAAO,GACP,UAAU,GACV,eAAe,GACf,YAAY,GACZ,MAAM,GACN,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,mBAAmB,GACnB,QAAQ,GACR,YAAY,GACZ,gBAAgB,GAChB,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,aAAa,GACb,iBAAiB,CAAC;AAEtB,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,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,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACrG,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
|
|
@@ -32,6 +32,10 @@ export declare const getGraphDataLength: ({ graphData, hideScroll, }: {
|
|
|
32
32
|
graphData?: unknown;
|
|
33
33
|
hideScroll?: boolean;
|
|
34
34
|
}) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Format large numbers into abbreviated form (K, M, B)
|
|
37
|
+
*/
|
|
38
|
+
export declare const formatLargeNumber: (value: number, prefix?: string) => string;
|
|
35
39
|
/**
|
|
36
40
|
* Get cartesian palette colors
|
|
37
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chartHelpers.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_utils/chartHelpers.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAAa,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,MAAM,EACf,eAAe,MAAM,GAAG,IAAI,KAC3B,MAaF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,eAAe,MAAM,EACrB,4BAAyB,KACxB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,KAAG,MACzB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,OAAO,KAAG,MACT,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,4BAGxB;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,MAKH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,4BAGhC;IACD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,MAMH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,KAAG,MAC1B,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,EAAE,cAAc,MAAM,KAAG,MASjF,CAAC"}
|
|
1
|
+
{"version":3,"file":"chartHelpers.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_utils/chartHelpers.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAAa,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,MAAM,EACf,eAAe,MAAM,GAAG,IAAI,KAC3B,MAaF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,eAAe,MAAM,EACrB,4BAAyB,KACxB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,KAAG,MACzB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,OAAO,KAAG,MACT,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,4BAGxB;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,MAKH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,4BAGhC;IACD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,MAMH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,eAAY,KAAG,MAY/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,KAAG,MAC1B,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,EAAE,cAAc,MAAM,KAAG,MASjF,CAAC"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { SERIES_TOOLTIP as u, PERCENT_TOOLTIP as
|
|
2
|
-
const o = () => "$",
|
|
1
|
+
import { SERIES_TOOLTIP as u, PERCENT_TOOLTIP as c, VALUE_TOOLTIP as i, EXTENDED_PALETTE as s, LABEL_STEP_DEFAULT as T } from "../_constant/constants.js";
|
|
2
|
+
const o = () => "$", l = (t, r) => {
|
|
3
3
|
const e = t || 0;
|
|
4
4
|
return r ?? (e <= 10 ? T : e < 20 ? "1" : "6");
|
|
5
|
-
},
|
|
5
|
+
}, E = (t, r = !0) => t === "" ? "" : r ? o() : t ?? o(), g = (t) => t || u, L = (t) => t ? c : i, f = ({
|
|
6
6
|
chartType: t,
|
|
7
7
|
hideScroll: r = !0
|
|
8
|
-
}) => t === "bar2d" ? r ? "bar2d" : "scrollBar2d" : r ? "column2d" : "scrollColumn2d",
|
|
8
|
+
}) => t === "bar2d" ? r ? "bar2d" : "scrollBar2d" : r ? "column2d" : "scrollColumn2d", $ = ({
|
|
9
9
|
graphData: t,
|
|
10
10
|
hideScroll: r = !0
|
|
11
|
-
}) => r ? Array.isArray(t) ? t.length : 0 : t?.dataset?.[0]?.data?.length || 0, m = (t
|
|
12
|
-
const
|
|
11
|
+
}) => r ? Array.isArray(t) ? t.length : 0 : t?.dataset?.[0]?.data?.length || 0, m = (t, r = "$") => {
|
|
12
|
+
const e = Math.abs(t);
|
|
13
|
+
return e >= 1e9 ? `${r}${(t / 1e9).toFixed(1)}B` : e >= 1e6 ? `${r}${(t / 1e6).toFixed(1)}M` : e >= 1e3 ? `${r}${(t / 1e3).toFixed(1)}K` : `${r}${t}`;
|
|
14
|
+
}, P = (t) => t || s, b = (t, r) => {
|
|
15
|
+
const n = (t || s).split(",").map((a) => a.trim());
|
|
13
16
|
return r && r > 0 ? n.slice(0, r).reverse().join(",") : n.reverse().join(",");
|
|
14
17
|
};
|
|
15
18
|
export {
|
|
19
|
+
m as formatLargeNumber,
|
|
16
20
|
f as getBarType,
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
P as getCartesianPalette,
|
|
22
|
+
E as getCurrencyPrefix,
|
|
19
23
|
o as getCurrencySymbol,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
b as getExtendedPalette,
|
|
25
|
+
$ as getGraphDataLength,
|
|
26
|
+
l as getLabelStep,
|
|
23
27
|
g as getSeriesTooltip,
|
|
24
28
|
L as getValueTooltip
|
|
25
29
|
};
|