@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.
@@ -1 +1 @@
1
- {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_config/builders.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAi/BpE,eAAO,MAAM,gBAAgB,GAAI,QAAO,OAAO,CAAC,gBAAgB,CAAM;;;;;;;QACD,CAAC"}
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 S, DEFAULT_WIDTH as m, STACKED_AREA_PALETTE as E } from "../_constant/constants.js";
2
- import { getBaseConfig as g, getStackedColumnChartShell as z, getStackedAreaChartShell as I, getStackedBarChartShell as H, getLineChartShell as F, getCommonChartShell as D, getScrollAreaChartShell as P, getMultipleLineChartShell as O, getMsCombiDy2dChartShell as R, getGroupChartShell as W, getDoughnutChartShell as Y } from "./helpers.js";
3
- import { getCurrencyPrefix as y, getLabelStep as p, getCartesianPalette as N, getCurrencySymbol as j, getBarType as V, getGraphDataLength as _ } from "../_utils/chartHelpers.js";
4
- const M = (e = {}) => {
5
- const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60), a = Array.isArray(e.graphData) ? e.graphData : [], r = a.some((l) => !!l.color), o = N(e?.palettecolors)?.split(",")?.map((l) => l?.trim());
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 l = e.graphData, s = l?.category || [], h = l?.dataset || [];
8
- if (h.length === 1) {
9
- const b = (h[0].data || []).map((f, v) => {
10
- const C = f.color || o[v % o.length], T = s[v]?.label || "";
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
- ...f,
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)}${f.value || ""}</b></div>`
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
- }), w = {
17
- ...D(e),
16
+ }), x = {
17
+ ...N(e),
18
18
  bgColor: e.bgColor || "#ffffff",
19
- labelStep: p(s.length, e.labelStep),
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 g({
35
- type: V(e),
34
+ return b({
35
+ type: M(e),
36
36
  width: m,
37
37
  height: e.height || "300",
38
- dataSource: { chart: w, data: b }
38
+ dataSource: { chart: x, data: f }
39
39
  });
40
40
  }
41
41
  }
42
- const n = a?.map((l, s) => {
43
- const h = l?.color || o[s % o.length];
44
- let x;
45
- return l.toolText ? x = l.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'>${l.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:${h};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${l.label || ""}</label></span><b style='text-align:right;color:#2B2B2B;font-weight:500;font-size:10px;'>${y(e.numberPrefix)}${l.value || ""}</b></div>`, {
46
- ...l,
47
- color: h,
48
- toolText: x
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
- }), i = {
52
- ...D(e),
51
+ }), n = {
52
+ ...N(e),
53
53
  bgColor: e.bgColor || "#ffffff",
54
- labelStep: p(_(e), e.labelStep),
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: r ? void 0 : N(e.palettecolors),
67
+ palettecolors: d ? void 0 : L(e.palettecolors),
68
68
  maxLabelHeight: e.maxLabelHeight,
69
69
  numbersuffix: e.numbersuffix || ""
70
- }, d = e.graphData, c = e?.hideScroll ? { chart: i, data: n?.length > 0 ? n : e?.graphData || [] } : {
71
- chart: i,
72
- categories: d?.categories,
73
- dataset: d?.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 g({
76
- type: V(e),
75
+ return b({
76
+ type: M(e),
77
77
  width: m,
78
78
  height: e.height || "300",
79
79
  dataSource: c
80
80
  });
81
- }, G = (e = {}) => g({
81
+ }, U = (e = {}) => b({
82
82
  type: "area2d",
83
83
  width: m,
84
84
  height: "550",
85
85
  dataSource: {
86
86
  chart: {
87
- ...D({ ...e, decimals: "2" }),
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;'>${j()}$value</b></div>`
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
- }), U = (e = {}) => {
97
- const t = Array.isArray(e?.graphData) ? e.graphData : [], a = y(e?.numberPrefix), r = (e?.palettecolors || "#8ECFFF").split(",")[0].trim(), o = t?.map((n) => ({
98
- ...n,
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'>${n?.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:${r};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#737373;'>${n?.label || ""}</label></span><b style='text-align:right; color:#2B2B2B;font-weight:500;font-size:10px;'>${a}${n?.value || ""}</b></div>`
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 g({
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
- ...F(e),
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: o.length > 0 ? o : e?.graphData || []
114
+ data: a.length > 0 ? a : e?.graphData || []
115
115
  }
116
116
  });
117
- }, K = (e = {}) => {
118
- let t = j();
117
+ }, X = (e = {}) => {
118
+ let t = E();
119
119
  e.numberPrefix === "" ? t = "" : e.numberPrefix !== null && e.numberPrefix !== void 0 && (t = e.numberPrefix);
120
- const a = e.graphData, r = (a?.dataset || []).some((n) => !!n.color), o = (a?.dataset || []).map((n, i) => {
121
- const c = n.data?.map((l) => {
122
- const s = l.value;
123
- return s == null || Number(s) === 0 || typeof s == "string" && s.trim() === "" ? { ...l, value: 0 } : l;
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
- ...n,
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 || (i === 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>")
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 g({
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
- ...W(e),
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(a?.category?.length, e.labelStep),
151
- ...r ? { palettecolors: void 0 } : {}
150
+ labelStep: p(l?.category?.length, e.labelStep),
151
+ ...d ? { palettecolors: void 0 } : {}
152
152
  },
153
- categories: [{ category: a?.category || [] }],
154
- dataset: o
153
+ categories: [{ category: l?.category || [] }],
154
+ dataset: a
155
155
  }
156
156
  });
157
- }, X = (e = {}) => {
158
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, r = (a?.dataset || []).some((i) => !!i.color), o = "<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>", n = (a?.dataset || []).map((i, d) => ({
159
- ...i,
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 || (d === 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>" + o : "<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>" + o)
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 g({
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
- ...z(e),
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: r ? void 0 : e.palettecolors || S,
185
+ palettecolors: d ? void 0 : e.palettecolors || $,
186
186
  numberPrefix: t,
187
- labelStep: p(a?.category?.length, e.labelStep),
187
+ labelStep: p(l?.category?.length, e.labelStep),
188
188
  showSum: e.showSum ? "1" : void 0
189
189
  },
190
190
  categories: [
191
- { category: a?.category || [] }
191
+ { category: l?.category || [] }
192
192
  ],
193
- dataset: n
193
+ dataset: i
194
194
  }
195
195
  });
196
- }, q = (e = {}) => {
197
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, r = (a?.dataset || []).map((o, n) => ({
198
- ...o,
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 || (n === 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>")
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 g({
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
- ...O(e),
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(a?.category?.length, e.labelStep),
224
+ labelStep: p(l?.category?.length, e.labelStep),
225
225
  showValues: e.showValues === "1" ? "1" : "0"
226
226
  },
227
- categories: [{ category: a?.category || [] }],
228
- dataset: r
227
+ categories: [{ category: l?.category || [] }],
228
+ dataset: d
229
229
  }
230
230
  });
231
- }, J = (e = {}) => {
232
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, o = (e.palettecolors || E).split(",").map((c) => c.trim()), n = a?.category || [], i = a?.dataset || [], d = i.map((c, l) => {
233
- const h = c.color || o[l % o.length], x = c.data || [];
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: h,
237
- plotBorderColor: h,
236
+ color: g,
237
+ plotBorderColor: g,
238
238
  plotBorderThickness: "2",
239
239
  plotBorderAlpha: "100",
240
- anchorBgColor: h,
241
- anchorBorderColor: h,
240
+ anchorBgColor: g,
241
+ anchorBorderColor: g,
242
242
  showPlotBorder: "1",
243
243
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
244
- data: x.map((u, b) => {
245
- const w = n[b]?.label || "";
244
+ data: h.map((w, f) => {
245
+ const x = i[f]?.label || "";
246
246
  if (e.plotToolText)
247
- return { ...u, alpha: "60" };
248
- if (l > 0)
247
+ return { ...w, alpha: "60" };
248
+ if (r > 0)
249
249
  return {
250
- ...u,
250
+ ...w,
251
251
  alpha: "60",
252
252
  toolText: " "
253
253
  };
254
- const f = i.map((v, C) => {
255
- const T = v.color || o[C % o.length], B = (v.data || [])[b]?.value ?? "", A = 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>${A}</span><b style='color:#2B2B2B;font-weight:500;font-size:10px;'>${t}${B}</b></div>`;
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
- ...u,
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'>${w}</div>${f}`
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 g({
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
- ...I(e),
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(a?.category?.length, e.labelStep)
284
+ labelStep: p(l?.category?.length, e.labelStep)
285
285
  },
286
- categories: [{ category: a?.category || [] }],
287
- dataset: d
286
+ categories: [{ category: l?.category || [] }],
287
+ dataset: s
288
288
  }
289
289
  });
290
- }, Q = (e = {}) => {
291
- const t = y(e.numberPrefix), r = (e?.palettecolors || "#8ECFFF").split(",").map((s) => s.trim()), o = r[0];
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 s = e.graphData, h = s?.category || [], x = s?.dataset || [], u = x.map((b, w) => {
294
- const f = b.color || r[w % r.length], v = b.data || [];
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
- ...b,
297
- color: f,
296
+ ...f,
297
+ color: u,
298
298
  anchorRadius: "3",
299
299
  anchorBgColor: "#FFFFFF",
300
- anchorBorderColor: f,
300
+ anchorBorderColor: u,
301
301
  anchorBorderThickness: "1",
302
302
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
303
303
  data: v.map((C, T) => {
304
- const $ = h[T]?.label || "";
304
+ const D = g[T]?.label || "";
305
305
  if (e.plotToolText)
306
306
  return { ...C };
307
- const B = x[w]?.seriesname || "", A = (x[w]?.data || [])[T]?.value ?? "", k = b.color || r[w % r.length], L = `<div class='scroll-area-tooltip-row' data-series-index='${w}' 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}${A}</b></div>`;
308
- return w === 0 ? {
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'>${$}</div>${L}`
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: L
314
+ toolText: P
315
315
  };
316
316
  })
317
317
  };
318
318
  });
319
- return g({
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
- ...P(e),
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: h }],
332
- dataset: u
331
+ categories: [{ category: g }],
332
+ dataset: w
333
333
  }
334
334
  });
335
335
  }
336
- const i = Array.isArray(e?.graphData) ? e.graphData : [], d = i.map((s) => ({ label: s?.label || "" })), c = e.legendLabel || "Spend", l = i.map((s) => ({
337
- value: s?.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'>${s?.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:${o};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}${s?.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'>${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 g({
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
- ...P(e),
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: d }],
353
+ categories: [{ category: s }],
354
354
  dataset: [
355
355
  {
356
356
  seriesname: c,
357
- color: o,
357
+ color: a,
358
358
  anchorRadius: "3",
359
359
  anchorBgColor: "#FFFFFF",
360
- anchorBorderColor: o,
360
+ anchorBorderColor: a,
361
361
  anchorBorderThickness: "1",
362
- data: l
362
+ data: r
363
363
  }
364
364
  ]
365
365
  }
366
366
  });
367
- }, Z = (e = {}) => {
367
+ }, ee = (e = {}) => {
368
368
  const t = e.graphData;
369
- return g({
369
+ return b({
370
370
  type: "stackedbar2d",
371
371
  width: m,
372
372
  height: e.height || "400",
373
373
  dataSource: {
374
374
  chart: {
375
- ...H(e),
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
- }, ee = (e = {}) => {
384
+ }, te = (e = {}) => {
385
385
  const t = e.graphData;
386
- return g({
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
- }, te = (e = {}) => {
417
- const a = e.graphData?.data || [], r = a.reduce((l, s) => l + (Number(s.value) || 0), 0), o = Math.round(r * 100) / 100, n = e.numberPrefix ?? "$", i = { ...e };
418
- if (!i.defaultCenterLabel)
419
- i.defaultCenterLabel = `Total{br}${n}${o}`;
420
- else if (i.defaultCenterLabel.includes("{br}")) {
421
- const [l] = i.defaultCenterLabel.split("{br}");
422
- i.defaultCenterLabel = `${l}{br}${n}${o}`;
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 d = (e.palettecolors || S).split(",").map((l) => l.trim()), c = a.map((l, s) => {
425
- const h = Number(l.value) || 0, x = o > 0 ? (h / o * 100).toFixed(2) : "0", u = l.color || d[s % d.length];
426
- let b;
427
- return l.toolText ? b = l.toolText : e.plotToolText ? b = e.plotToolText : b = `<div style='font-size: 10px;font-weight:500;color:#2b2b2b;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${l.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:${u};display:inline-block;margin-right:5px;color:#AAAAAA;'></span>${l.label}</label><b style='text-align:right;color:#2b2b2b;font-weight:500;font-size:10px;'>${n}${h}</b></div>`, b = b.replace(/\$plotFillColor/g, u).replace(/\$color/g, u).replace(/\$label/g, l.label || "").replace(/\$value/g, String(l.value ?? "")).replace(/\$dataValue/g, `${n}${h}`).replace(/\$percentValue/g, x).replace(/\$unformattedSum/g, String(o)).replace(/\$sum/g, `${n}${o}`), {
428
- ...l,
429
- color: u,
430
- displayValue: `${n}${l.value} (${x}%){br}${l.label}`,
431
- toolText: b
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 g({
434
+ return b({
435
435
  type: "doughnut2d",
436
436
  width: e.width || "136",
437
437
  height: e.height || "136",
438
438
  dataSource: {
439
- chart: Y(i),
440
- data: c
439
+ chart: _(n),
440
+ data: r
441
441
  }
442
442
  });
443
- }, ae = (e = {}) => {
443
+ }, le = (e = {}) => {
444
444
  const t = e.graphData;
445
- return g({
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
- }, le = (e = {}) => {
456
+ }, oe = (e = {}) => {
457
457
  const t = e.graphData;
458
- return g({
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
- }, oe = (e = {}) => {
468
- let t = [], a = [];
467
+ }, ie = (e = {}) => {
468
+ let t = [], l = [];
469
469
  if (Array.isArray(e.graphData)) {
470
- const i = e.graphData;
471
- t = i.map((d) => ({ label: d.label || "" })), a = [
470
+ const n = e.graphData;
471
+ t = n.map((s) => ({ label: s.label || "" })), l = [
472
472
  {
473
473
  seriesname: "Series 1",
474
- data: i.map((d) => ({ value: d.value }))
474
+ data: n.map((s) => ({ value: s.value }))
475
475
  }
476
476
  ];
477
477
  } else {
478
- const i = e.graphData;
479
- t = i?.category || [], a = (i?.dataset || []).map((d) => ({
480
- ...d,
481
- seriesname: d.seriesname || "Series",
482
- data: d.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 r = y(e.numberPrefix), o = a.some((i) => !!i.color), n = {
486
- ...D(e),
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: r,
499
+ numberPrefix: d,
500
500
  numVDivLines: e.numVDivLines || "5",
501
- palettecolors: o ? void 0 : N(e.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 g({
513
+ return b({
514
514
  type: "scrollcolumn2d",
515
515
  width: e.width || m,
516
516
  height: e.height || "400",
517
517
  dataSource: {
518
- chart: n,
518
+ chart: i,
519
519
  categories: [{ category: t }],
520
- dataset: a
520
+ dataset: l
521
521
  }
522
522
  });
523
- }, ie = (e = {}) => {
524
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, r = (a?.dataset || []).some((i) => !!i.color), o = "<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>", n = (a?.dataset || []).map((i, d) => ({
525
- ...i,
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 || (d === 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>" + o : "<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>" + o)
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 g({
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
- ...z(e),
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: r ? void 0 : e.palettecolors || S,
548
+ palettecolors: d ? void 0 : e.palettecolors || $,
549
549
  numberPrefix: t,
550
550
  numVDivLines: e.numVDivLines || "5",
551
- labelStep: p(a?.category?.length, e.labelStep),
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: a?.category || [] }],
561
- dataset: n
560
+ categories: [{ category: l?.category || [] }],
561
+ dataset: i
562
562
  }
563
563
  });
564
- }, ne = (e = {}) => {
565
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, r = (a?.dataset || []).some((c) => !!c.color), o = (e.palettecolors || S).split(",").map((c) => c.trim()), n = a?.category || [], i = a?.dataset || [], d = i.map((c, l) => {
566
- const s = c.color || o[l % o.length], h = c.data || [];
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: s,
569
+ color: o,
570
570
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
571
- data: h.map((x, u) => {
572
- const b = n[u]?.label || "";
571
+ data: g.map((h, w) => {
572
+ const f = i[w]?.label || "";
573
573
  if (e.plotToolText)
574
- return { ...x };
575
- if (l > 0)
576
- return { ...x, toolText: " " };
577
- const w = i.map((f, v) => {
578
- const C = f.color || o[v % o.length], $ = (f.data || [])[u]?.value ?? "", B = f.seriesname || "", A = f.tooltipPrefix !== void 0 ? f.tooltipPrefix : t, k = f.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;'>${A}${$}</b></div>`;
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
- ...x,
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'>${b}</div>${w}`
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 g({
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
- ...R(e),
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(n.length, e.labelStep),
604
- palettecolors: r ? void 0 : e.palettecolors || S
603
+ labelStep: p(i.length, e.labelStep),
604
+ palettecolors: d ? void 0 : e.palettecolors || $
605
605
  },
606
- categories: [{ category: n }],
607
- dataset: d
606
+ categories: [{ category: i }],
607
+ dataset: s
608
608
  }
609
609
  });
610
- }, se = (e = {}) => {
611
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, r = a?.category || [], o = a?.dataset || [];
612
- return g({
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
- ...F(e),
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(r.length, e?.labelStep),
632
+ labelStep: p(d.length, e?.labelStep),
633
633
  ...e?.plotToolText ? { plotToolText: e.plotToolText } : {},
634
634
  ...e?.chartConfig || {}
635
635
  },
636
- categories: [{ category: r }],
637
- dataset: o
636
+ categories: [{ category: d }],
637
+ dataset: a
638
638
  }
639
639
  });
640
- }, re = {
641
- area: G,
642
- bar2d: M,
643
- column2d: M,
644
- doughnutChart: te,
645
- groupChart: K,
646
- line: U,
647
- msCombiDy2d: ne,
648
- multiAxisLineChart: ae,
649
- multilevelpie: le,
650
- multipleLineChart: q,
651
- sankey: ee,
652
- scrollArea: Q,
653
- scrollColumn2d: oe,
654
- scrollLine2d: se,
655
- scrollStackedColumn2d: ie,
656
- stackBarChart: Z,
657
- stackedArea: J,
658
- stackedcolumn2d: X
659
- }, ge = (e = {}) => e.chartType ? re[e.chartType]?.(e) ?? null : null;
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
- ge as buildChartConfig
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;AAED,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,gBAAqB,GAAG,IAAI,CAiMxE"}
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 N(g = {}) {
2
- const m = g?.sender?.container;
3
- if (!m) return;
4
- const f = g?.sender?.originalDataSource?.data || [], b = g?.sender?.originalDataSource?.chart?.numberPrefix || "", h = f.reduce((e, n) => e + (Number(n.value) || 0), 0), $ = 50, x = {};
5
- f.forEach((e) => {
6
- e.label && (x[e.label] = { value: e.value, label: e.label });
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
- const B = new Set(f.map((e) => e.label).filter(Boolean));
9
- Array.from(m.querySelectorAll("text")).forEach((e) => {
10
- const n = e, o = n?.textContent?.trim() || "";
11
- if (x[o] || o.length === 0) return;
12
- const a = String(h);
13
- if (f.some((s) => {
14
- const t = Number(s.value) || 0, i = h > 0 ? (t / h * 100).toFixed(2) : "0", l = `${b}${s.value} (${i}%)`;
15
- return o.includes(l) || s.label && o.includes(s.label) && o.includes(b);
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
- const s = n.querySelectorAll("tspan");
18
- s.length > 0 ? s.forEach((t, i) => {
19
- const l = t.textContent?.trim() || "";
20
- if (t.setAttribute("font-family", "Inter, sans-serif"), i === 0 || !B.has(l) && l.includes(b)) {
21
- const r = l.match(/^(.+?)(\s*\(\d+\.\d+%\))$/);
22
- if (r) {
23
- const v = r[1], u = r[2];
24
- t.textContent = "", t.setAttribute("font-size", "10"), t.setAttribute("fill", "#2B2B2B"), t.setAttribute("font-weight", "600");
25
- const A = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
26
- A.textContent = u, A.setAttribute("font-weight", "400"), t.appendChild(document.createTextNode(v)), t.appendChild(A);
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
- t.setAttribute("font-weight", "600"), t.setAttribute("font-size", "10"), t.setAttribute("fill", "#2b2b2b");
81
+ e.setAttribute("font-weight", "600"), e.setAttribute("font-size", "10"), e.setAttribute("fill", "#2b2b2b");
29
82
  } else
30
- t.setAttribute("font-weight", "400"), t.setAttribute("font-size", "10"), t.setAttribute("fill", "#737373"), i === 1 && t.setAttribute("dy", "16");
31
- }) : (n.setAttribute("font-family", "Inter, sans-serif"), n.setAttribute("font-weight", "700"), n.setAttribute("fill", "#2b2b2b"));
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 (o.includes(a) || o.includes("Total") || o.includes("Resource")) {
35
- const s = n.querySelectorAll("tspan");
36
- s.length > 0 ? s.forEach((t) => {
37
- const i = t.textContent?.trim() || "";
38
- t.setAttribute("font-family", "Inter, sans-serif"), i === a || i === `${b}${h}` ? (t.setAttribute("font-weight", "600"), t.setAttribute("font-size", "11"), t.setAttribute("fill", "#2B2B2B"), t.setAttribute("dy", "16")) : (t.setAttribute("font-weight", "400"), t.setAttribute("font-size", "10"), t.setAttribute("fill", "#737373"));
39
- }) : (n.setAttribute("font-family", "Inter, sans-serif"), o === a || o === `${b}${h}` ? (n.setAttribute("font-weight", "600"), n.setAttribute("font-size", "11"), n.setAttribute("fill", "#2B2B2B")) : (n.setAttribute("font-weight", "400"), n.setAttribute("font-size", "10"), n.setAttribute("fill", "#737373")));
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 y = {};
43
- f.slice().sort((e, n) => n.value - e.value).forEach((e, n) => {
44
- e.label && (y[e.label] = n + 1);
45
- });
46
- const T = Array.from(m.querySelectorAll("text")), p = [];
47
- T.forEach((e) => {
48
- const n = e?.textContent?.trim() || "";
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
- S.push({ x: n, y: o, el: e, text: a });
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
- N as adjustDoughnutLabels
118
+ T as adjustDoughnutLabels
80
119
  };
@@ -135,5 +135,6 @@ export interface FusionChartProps {
135
135
  seriesName?: string;
136
136
  datasetIndex: number;
137
137
  } | null) => void;
138
+ formateLargeAmount?: boolean;
138
139
  }
139
140
  //# sourceMappingURL=fusionChart.types.d.ts.map
@@ -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,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,CAA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CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,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;CACtG"}
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,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AAe,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 l, VALUE_TOOLTIP as c, EXTENDED_PALETTE as a, LABEL_STEP_DEFAULT as T } from "../_constant/constants.js";
2
- const o = () => "$", i = (t, r) => {
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
- }, d = (t, r = !0) => t === "" ? "" : r ? o() : t ?? o(), g = (t) => t || u, L = (t) => t ? l : c, f = ({
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", P = ({
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) => t || a, y = (t, r) => {
12
- const n = (t || a).split(",").map((s) => s.trim());
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
- m as getCartesianPalette,
18
- d as getCurrencyPrefix,
21
+ P as getCartesianPalette,
22
+ E as getCurrencyPrefix,
19
23
  o as getCurrencySymbol,
20
- y as getExtendedPalette,
21
- P as getGraphDataLength,
22
- i as getLabelStep,
24
+ b as getExtendedPalette,
25
+ $ as getGraphDataLength,
26
+ l as getLabelStep,
23
27
  g as getSeriesTooltip,
24
28
  L as getValueTooltip
25
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ck-ui/component-library",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",