vue-chrts 0.2.5 → 1.0.0-test.2
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/AreaChart/AreaChart.js +103 -73
- package/dist/components/AreaChart/types.d.ts +26 -9
- package/dist/components/BarChart/BarChart.js +91 -85
- package/dist/components/BarChart/stackedGroupedUtils.d.ts +2 -3
- package/dist/components/BarChart/types.d.ts +13 -1
- package/dist/components/BubbleChart/BubbleChart.js +78 -61
- package/dist/components/BubbleChart/BubbleChart.vue.d.ts +1 -1
- package/dist/components/BubbleChart/types.d.ts +15 -17
- package/dist/components/DonutChart/DonutChart.js +87 -69
- package/dist/components/DonutChart/types.d.ts +16 -8
- package/dist/components/GanttChart/GanttChart.js +140 -0
- package/dist/components/GanttChart/GanttChart.vue.d.ts +33 -0
- package/dist/components/GanttChart/GanttChart2.js +4 -0
- package/dist/components/GanttChart/types.d.ts +112 -0
- package/dist/components/LineChart/LineChart.js +27 -129
- package/dist/components/LineChart/LineChart.vue.d.ts +9 -8
- package/dist/components/LineChart/types.d.ts +2 -140
- package/dist/components/Tooltip.js +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -13
- package/dist/types.d.ts +24 -14
- package/dist/types.js +4 -4
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +27 -26
- package/package.json +1 -1
- package/dist/components/AreaStackedChart/AreaStackedChart.js +0 -77
- package/dist/components/AreaStackedChart/AreaStackedChart.vue.d.ts +0 -14
- package/dist/components/AreaStackedChart/AreaStackedChart2.js +0 -4
- package/dist/components/AreaStackedChart/types.d.ts +0 -86
|
@@ -2,7 +2,7 @@ import { defineComponent as y, computed as f, createElementBlock as r, openBlock
|
|
|
2
2
|
const x = { style: { padding: "10px 15px" } }, _ = { style: {
|
|
3
3
|
color: "var(--tooltip-value-color)",
|
|
4
4
|
textTransform: "capitalize",
|
|
5
|
-
borderBottom: "1px solid
|
|
5
|
+
borderBottom: "1px solid var(--tooltip-border-color)",
|
|
6
6
|
marginBottom: "0.25rem",
|
|
7
7
|
paddingBottom: "0.25rem"
|
|
8
8
|
} }, T = /* @__PURE__ */ y({
|
|
@@ -15,28 +15,28 @@ const x = { style: { padding: "10px 15px" } }, _ = { style: {
|
|
|
15
15
|
},
|
|
16
16
|
setup(d) {
|
|
17
17
|
const a = d, m = ["_index", "_stacked", "_ending"], g = f(() => Object.entries(a.data ?? []).filter(
|
|
18
|
-
([
|
|
18
|
+
([o, u]) => !m.includes(o) && Object.keys(a.categories).includes(o)
|
|
19
19
|
));
|
|
20
|
-
return (
|
|
21
|
-
e("div", _, l(
|
|
22
|
-
(i(!0), r(h, null, b(g.value, ([
|
|
20
|
+
return (o, u) => (i(), r("div", x, [
|
|
21
|
+
e("div", _, l(o.toolTipTitle), 1),
|
|
22
|
+
(i(!0), r(h, null, b(g.value, ([t, s], v) => {
|
|
23
23
|
var p, c;
|
|
24
24
|
return i(), r("div", {
|
|
25
|
-
key:
|
|
25
|
+
key: t,
|
|
26
26
|
style: { display: "flex", "align-items": "center", "margin-bottom": "4px" }
|
|
27
27
|
}, [
|
|
28
28
|
e("span", {
|
|
29
29
|
style: n([{ width: "8px", height: "8px", "border-radius": "4px", "margin-right": "8px" }, {
|
|
30
|
-
backgroundColor: typeof ((p =
|
|
30
|
+
backgroundColor: typeof ((p = o.categories[t]) == null ? void 0 : p.color) == "string" && ((c = o.categories[t]) != null && c.color) ? o.categories[t].color : `var(--vis-color${v})`
|
|
31
31
|
}])
|
|
32
32
|
}, null, 4),
|
|
33
33
|
e("div", null, [
|
|
34
34
|
e("span", {
|
|
35
35
|
style: n([{ "font-weight": "600", "margin-right": "8px" }, { color: "var(--tooltip-label-color)" }])
|
|
36
|
-
}, l(
|
|
36
|
+
}, l(o.categories[t].name) + ":", 1),
|
|
37
37
|
e("span", {
|
|
38
38
|
style: n([{ "font-weight": "400" }, { color: "var(--tooltip-value-color)" }])
|
|
39
|
-
}, l(
|
|
39
|
+
}, l(o.yFormatter ? o.yFormatter(s) : s), 1)
|
|
40
40
|
])
|
|
41
41
|
]);
|
|
42
42
|
}), 128))
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as AreaChart } from './components/AreaChart/AreaChart.vue';
|
|
2
|
-
import { default as AreaStackedChart } from './components/AreaStackedChart/AreaStackedChart.vue';
|
|
3
2
|
import { default as LineChart } from './components/LineChart/LineChart.vue';
|
|
4
3
|
import { default as BarChart } from './components/BarChart/BarChart.vue';
|
|
5
4
|
import { default as DonutChart } from './components/DonutChart/DonutChart.vue';
|
|
6
5
|
import { default as BubbleChart } from './components/BubbleChart/BubbleChart.vue';
|
|
6
|
+
import { default as GanttChart } from './components/GanttChart/GanttChart.vue';
|
|
7
7
|
import { LegendPosition, CurveType, Orientation, BulletLegendItemInterface, MarkerConfig, CrosshairConfig } from './types';
|
|
8
|
-
export { AreaChart,
|
|
8
|
+
export { AreaChart, LineChart, BarChart, DonutChart, BubbleChart, GanttChart, Orientation, CurveType, LegendPosition };
|
|
9
9
|
export type { BulletLegendItemInterface, MarkerConfig, CrosshairConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { default as a } from "./components/AreaChart/AreaChart.js";
|
|
2
|
-
import { default as o } from "./components/
|
|
3
|
-
import { default as u } from "./components/
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as m } from "./components/
|
|
6
|
-
import { default as
|
|
7
|
-
import { CurveType as
|
|
2
|
+
import { default as o } from "./components/LineChart/LineChart.js";
|
|
3
|
+
import { default as u } from "./components/BarChart/BarChart.js";
|
|
4
|
+
import { default as d } from "./components/DonutChart/DonutChart.js";
|
|
5
|
+
import { default as m } from "./components/BubbleChart/BubbleChart.js";
|
|
6
|
+
import { default as s } from "./components/GanttChart/GanttChart.js";
|
|
7
|
+
import { CurveType as C, LegendPosition as h, Orientation as i } from "./types.js";
|
|
8
8
|
export {
|
|
9
9
|
a as AreaChart,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
u as BarChart,
|
|
11
|
+
m as BubbleChart,
|
|
12
|
+
C as CurveType,
|
|
13
|
+
d as DonutChart,
|
|
14
|
+
s as GanttChart,
|
|
15
|
+
h as LegendPosition,
|
|
16
|
+
o as LineChart,
|
|
17
17
|
i as Orientation
|
|
18
18
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -3,9 +3,14 @@ import { BarChartProps } from './components/BarChart/types';
|
|
|
3
3
|
import { LineChartProps } from './components/LineChart/types';
|
|
4
4
|
import { DonutChartProps } from './components/DonutChart/types';
|
|
5
5
|
import { BubbleChartProps } from './components/BubbleChart/types';
|
|
6
|
+
import { GanttChartProps } from './components/GanttChart/types';
|
|
6
7
|
declare enum LegendPosition {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
TopLeft = "top-left",
|
|
9
|
+
TopCenter = "top-center",
|
|
10
|
+
TopRight = "top-right",
|
|
11
|
+
BottomLeft = "bottom-left",
|
|
12
|
+
BottomCenter = "bottom-center",
|
|
13
|
+
BottomRight = "bottom-right"
|
|
9
14
|
}
|
|
10
15
|
declare enum CurveType {
|
|
11
16
|
Basis = "basis",
|
|
@@ -31,7 +36,6 @@ interface BulletLegendItemInterface {
|
|
|
31
36
|
name: string | number;
|
|
32
37
|
color?: string | Array<string>;
|
|
33
38
|
className?: string;
|
|
34
|
-
shape?: any;
|
|
35
39
|
inactive?: boolean;
|
|
36
40
|
hidden?: boolean;
|
|
37
41
|
pointer?: boolean;
|
|
@@ -40,8 +44,24 @@ declare enum Orientation {
|
|
|
40
44
|
Horizontal = "horizontal",
|
|
41
45
|
Vertical = "vertical"
|
|
42
46
|
}
|
|
43
|
-
export { LegendPosition, CurveType, Orientation, type AreaChartProps, type BarChartProps, type LineChartProps, type DonutChartProps, type BulletLegendItemInterface, type BubbleChartProps };
|
|
47
|
+
export { LegendPosition, CurveType, Orientation, type AreaChartProps, type BarChartProps, type LineChartProps, type DonutChartProps, type BulletLegendItemInterface, type BubbleChartProps, type GanttChartProps, };
|
|
44
48
|
export type axisFormatter = ((tick: number, i?: number, ticks?: number[]) => string) | ((tick: Date, i?: number, ticks?: Date[]) => string);
|
|
49
|
+
export interface AxisConfig {
|
|
50
|
+
tickLine?: boolean;
|
|
51
|
+
tickTextFontSize?: string;
|
|
52
|
+
tickTextColor?: string;
|
|
53
|
+
tickFormat?: axisFormatter;
|
|
54
|
+
tickTextAlign?: "left" | "right" | "center";
|
|
55
|
+
tickTextAngle?: number;
|
|
56
|
+
tickTextWidth?: number;
|
|
57
|
+
tickTextFitMode?: "wrap" | "trim";
|
|
58
|
+
tickTextTrimType?: "start" | "middle" | "end";
|
|
59
|
+
tickTextForceWordBreak?: boolean;
|
|
60
|
+
tickTextSeparator?: string | readonly string[];
|
|
61
|
+
minMaxTicksOnly?: boolean;
|
|
62
|
+
minMaxTicksOnlyShowGridLines?: boolean;
|
|
63
|
+
tickValues?: readonly number[] | readonly Date[];
|
|
64
|
+
}
|
|
45
65
|
export interface MarkerConfig {
|
|
46
66
|
type?: "circle" | "square" | "triangle" | "diamond";
|
|
47
67
|
size?: number;
|
|
@@ -50,17 +70,7 @@ export interface MarkerConfig {
|
|
|
50
70
|
strokeColor?: string;
|
|
51
71
|
}
|
|
52
72
|
export interface CrosshairConfig {
|
|
53
|
-
/**
|
|
54
|
-
* The color of the crosshair line. Accepts any valid CSS color string.
|
|
55
|
-
* Example: '#f00', 'rgba(0,0,0,0.5)', 'blue'
|
|
56
|
-
*/
|
|
57
73
|
color?: string;
|
|
58
|
-
/**
|
|
59
|
-
* The stroke color of the crosshair line. Accepts any valid CSS color string.
|
|
60
|
-
*/
|
|
61
74
|
strokeColor?: string;
|
|
62
|
-
/**
|
|
63
|
-
* The stroke width of the crosshair line in pixels.
|
|
64
|
-
*/
|
|
65
75
|
strokeWidth?: number;
|
|
66
76
|
}
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o = /* @__PURE__ */ ((t) => (t.TopLeft = "top-left", t.TopCenter = "top-center", t.TopRight = "top-right", t.BottomLeft = "bottom-left", t.BottomCenter = "bottom-center", t.BottomRight = "bottom-right", t))(o || {}), a = /* @__PURE__ */ ((t) => (t.Basis = "basis", t.BasisClosed = "basisClosed", t.BasisOpen = "basisOpen", t.Bundle = "bundle", t.Cardinal = "cardinal", t.CardinalClosed = "cardinalClosed", t.CardinalOpen = "cardinalOpen", t.CatmullRom = "catmullRom", t.CatmullRomClosed = "catmullRomClosed", t.CatmullRomOpen = "catmullRomOpen", t.Linear = "linear", t.LinearClosed = "linearClosed", t.MonotoneX = "monotoneX", t.MonotoneY = "monotoneY", t.Natural = "natural", t.Step = "step", t.StepAfter = "stepAfter", t.StepBefore = "stepBefore", t))(a || {}), l = /* @__PURE__ */ ((t) => (t.Horizontal = "horizontal", t.Vertical = "vertical", t))(l || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
a as CurveType,
|
|
4
|
+
o as LegendPosition,
|
|
5
|
+
l as Orientation
|
|
6
6
|
};
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (
|
|
3
|
-
const e = Object.keys(
|
|
4
|
-
return
|
|
1
|
+
function m(t) {
|
|
2
|
+
if (t && Object.keys(t).length > 0) {
|
|
3
|
+
const e = Object.keys(t)[0];
|
|
4
|
+
return t[e];
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
switch (
|
|
7
|
+
const o = (t, e, r, n, $) => {
|
|
8
|
+
switch (t) {
|
|
9
9
|
case "circle":
|
|
10
|
-
return `<circle cx="${e / 2}" cy="${e / 2}" r="${(e - r) / 2}" stroke-width="${r}" stroke="${$}" fill="${
|
|
10
|
+
return `<circle cx="${e / 2}" cy="${e / 2}" r="${(e - r) / 2}" stroke-width="${r}" stroke="${$}" fill="${n}" />`;
|
|
11
11
|
case "square":
|
|
12
|
-
return `<rect x="${r / 2}" y="${r / 2}" width="${e - r}" height="${e - r}" stroke-width="${r}" stroke="${$}" fill="${
|
|
12
|
+
return `<rect x="${r / 2}" y="${r / 2}" width="${e - r}" height="${e - r}" stroke-width="${r}" stroke="${$}" fill="${n}" />`;
|
|
13
13
|
case "triangle":
|
|
14
|
-
return `<polygon points="${e / 2},${r / 2} ${e - r / 2},${e - r / 2} ${r / 2},${e - r / 2}" stroke-width="${r}" stroke="${$}" fill="${
|
|
14
|
+
return `<polygon points="${e / 2},${r / 2} ${e - r / 2},${e - r / 2} ${r / 2},${e - r / 2}" stroke-width="${r}" stroke="${$}" fill="${n}" />`;
|
|
15
15
|
case "diamond":
|
|
16
|
-
return `<polygon points="${e / 2},${r / 2} ${e - r / 2},${e / 2} ${e / 2},${e - r / 2} ${r / 2},${e / 2}" stroke-width="${r}" stroke="${$}" fill="${
|
|
16
|
+
return `<polygon points="${e / 2},${r / 2} ${e - r / 2},${e / 2} ${e / 2},${e - r / 2} ${r / 2},${e / 2}" stroke-width="${r}" stroke="${$}" fill="${n}" />`;
|
|
17
17
|
default:
|
|
18
18
|
return "";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
return Object.entries(
|
|
23
|
-
const
|
|
21
|
+
function p(t) {
|
|
22
|
+
return Object.entries(t).map(([e, r]) => {
|
|
23
|
+
const n = r.type || "circle", $ = r.size || 10, c = r.strokeWidth || 2, a = r.color || "#000", l = r.strokeColor || r.color || "#000";
|
|
24
24
|
return `<marker id="circle-marker-${e}" viewBox="0 0 ${$} ${$}" refX="${$ / 2}" refY="${$ / 2}" markerWidth="${$ / 2}" markerHeight="${$ / 2}">
|
|
25
|
-
${
|
|
25
|
+
${o(n, $, c, a, l)}
|
|
26
26
|
</marker>`;
|
|
27
27
|
}).join(`
|
|
28
28
|
`);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function u(t) {
|
|
31
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
const r = Object.keys(
|
|
35
|
-
return
|
|
33
|
+
const f = (t, e) => {
|
|
34
|
+
const r = Object.keys(t[0]).filter(($) => $ !== e), n = Object.keys(t[0][r[0]]);
|
|
35
|
+
return t.map(($) => ({
|
|
36
36
|
month: $.month,
|
|
37
37
|
...r.flatMap(
|
|
38
|
-
(c) =>
|
|
39
|
-
[`${c}${
|
|
38
|
+
(c) => n.map((a) => ({
|
|
39
|
+
[`${c}${u(a)}`]: $[c][a]
|
|
40
40
|
}))
|
|
41
41
|
).reduce((c, a) => ({ ...c, ...a }), {})
|
|
42
42
|
}));
|
|
43
|
-
};
|
|
43
|
+
}, y = (t) => Intl.DateTimeFormat().format(t);
|
|
44
44
|
export {
|
|
45
|
-
|
|
46
|
-
y as
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
p as createMarkers,
|
|
46
|
+
y as dateFormatter,
|
|
47
|
+
f as flattenData,
|
|
48
|
+
m as getFirstPropertyValue,
|
|
49
|
+
o as markerShape
|
|
49
50
|
};
|
package/package.json
CHANGED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, computed as f, createApp as h, createElementBlock as g, openBlock as a, createVNode as n, createElementVNode as B, unref as t, withCtx as L, createBlock as v, createCommentVNode as C, mergeProps as k } from "vue";
|
|
2
|
-
import { VisXYContainer as b, VisArea as x, VisAxis as s, VisCrosshair as T, VisBulletLegend as V } from "@unovis/vue";
|
|
3
|
-
import { CurveType as _ } from "@unovis/ts";
|
|
4
|
-
import N from "../Tooltip.js";
|
|
5
|
-
const A = { class: "flex flex-col space-y-4" }, j = { class: "flex items center justify-end" }, O = /* @__PURE__ */ y({
|
|
6
|
-
__name: "AreaStackedChart",
|
|
7
|
-
props: {
|
|
8
|
-
data: {},
|
|
9
|
-
height: {},
|
|
10
|
-
categories: {},
|
|
11
|
-
hideTooltip: { type: Boolean },
|
|
12
|
-
xLabel: {},
|
|
13
|
-
yLabel: {},
|
|
14
|
-
padding: {},
|
|
15
|
-
hideLegend: { type: Boolean },
|
|
16
|
-
xGridLine: { type: Boolean },
|
|
17
|
-
xDomainLine: { type: Boolean },
|
|
18
|
-
yGridLine: { type: Boolean },
|
|
19
|
-
yDomainLine: { type: Boolean },
|
|
20
|
-
xTickLine: { type: Boolean },
|
|
21
|
-
yTickLine: { type: Boolean },
|
|
22
|
-
crosshairConfig: {}
|
|
23
|
-
},
|
|
24
|
-
setup(c) {
|
|
25
|
-
const i = c, l = f(() => (e, m) => {
|
|
26
|
-
if (typeof window > "u" || typeof document > "u")
|
|
27
|
-
return "";
|
|
28
|
-
try {
|
|
29
|
-
const o = h(N, {
|
|
30
|
-
data: e,
|
|
31
|
-
categories: i.categories
|
|
32
|
-
}), r = document.createElement("div");
|
|
33
|
-
o.mount(r);
|
|
34
|
-
const u = r.innerHTML;
|
|
35
|
-
return o.unmount(), u;
|
|
36
|
-
} catch {
|
|
37
|
-
return "";
|
|
38
|
-
}
|
|
39
|
-
}), p = (e) => Number.parseInt(e.time), d = [(e) => e.firstTime, (e) => e.returning];
|
|
40
|
-
return (e, m) => (a(), g("div", A, [
|
|
41
|
-
n(t(b), {
|
|
42
|
-
data: e.data,
|
|
43
|
-
padding: e.padding,
|
|
44
|
-
height: e.height
|
|
45
|
-
}, {
|
|
46
|
-
default: L(() => [
|
|
47
|
-
n(t(x), {
|
|
48
|
-
x: p,
|
|
49
|
-
y: d,
|
|
50
|
-
color: Object.values(i.categories).map((o) => o.color),
|
|
51
|
-
"curve-type": t(_).Linear
|
|
52
|
-
}, null, 8, ["color", "curve-type"]),
|
|
53
|
-
n(t(s), {
|
|
54
|
-
type: "x",
|
|
55
|
-
label: "Time",
|
|
56
|
-
"num-ticks": 12
|
|
57
|
-
}),
|
|
58
|
-
n(t(s), {
|
|
59
|
-
type: "y",
|
|
60
|
-
label: "Number of visitors",
|
|
61
|
-
"num-ticks": 3
|
|
62
|
-
}),
|
|
63
|
-
e.hideTooltip ? C("", !0) : (a(), v(t(T), k({ key: 0 }, e.crosshairConfig, { template: l.value }), null, 16, ["template"]))
|
|
64
|
-
]),
|
|
65
|
-
_: 1
|
|
66
|
-
}, 8, ["data", "padding", "height"]),
|
|
67
|
-
B("div", j, [
|
|
68
|
-
n(t(V), {
|
|
69
|
-
items: Object.values(e.categories)
|
|
70
|
-
}, null, 8, ["items"])
|
|
71
|
-
])
|
|
72
|
-
]));
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
export {
|
|
76
|
-
O as default
|
|
77
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AreaStackedChartProps } from './types';
|
|
2
|
-
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & AreaStackedChartProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
4
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
5
|
-
attrs: any;
|
|
6
|
-
slots: {};
|
|
7
|
-
emit: {};
|
|
8
|
-
}>) => import('vue').VNode & {
|
|
9
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
12
|
-
type __VLS_PrettifyLocal<T> = {
|
|
13
|
-
[K in keyof T]: T[K];
|
|
14
|
-
} & {};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { BulletLegendItemInterface } from '@unovis/ts';
|
|
2
|
-
export interface AreaStackedChartProps<T> {
|
|
3
|
-
/**
|
|
4
|
-
* The data to be displayed in the stacked area chart.
|
|
5
|
-
* Each element of the array represents a data point.
|
|
6
|
-
* The structure of 'T' should be compatible with the chart's rendering logic.
|
|
7
|
-
*/
|
|
8
|
-
data: T[];
|
|
9
|
-
/**
|
|
10
|
-
* The height of the chart in pixels.
|
|
11
|
-
*/
|
|
12
|
-
height: number;
|
|
13
|
-
/**
|
|
14
|
-
* A record mapping category keys to `BulletLegendItemInterface` objects.
|
|
15
|
-
* This defines the visual representation and labels for each category in the chart's legend.
|
|
16
|
-
*/
|
|
17
|
-
categories: Record<string, BulletLegendItemInterface>;
|
|
18
|
-
/**
|
|
19
|
-
* If `true`, hides the chart tooltip.
|
|
20
|
-
*/
|
|
21
|
-
hideTooltip?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Optional label for the x-axis.
|
|
24
|
-
*/
|
|
25
|
-
xLabel?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Optional label for the y-axis.
|
|
28
|
-
*/
|
|
29
|
-
yLabel?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Optional padding applied to the chart.
|
|
32
|
-
* Allows specifying individual padding values for the top, right, bottom, and left sides.
|
|
33
|
-
*/
|
|
34
|
-
padding?: {
|
|
35
|
-
top: number;
|
|
36
|
-
right: number;
|
|
37
|
-
bottom: number;
|
|
38
|
-
left: number;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* If `true`, hides the chart legend.
|
|
42
|
-
*/
|
|
43
|
-
hideLegend?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* If `true`, displays grid lines along the x-axis.
|
|
46
|
-
*/
|
|
47
|
-
xGridLine?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* If `true`, displays a domain line (axis line) along the x-axis.
|
|
50
|
-
*/
|
|
51
|
-
xDomainLine?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* If `true`, displays grid lines along the y-axis.
|
|
54
|
-
*/
|
|
55
|
-
yGridLine?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* If `true`, displays a domain line (axis line) along the y-axis.
|
|
58
|
-
*/
|
|
59
|
-
yDomainLine?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* If `true`, displays tick lines on the x-axis.
|
|
62
|
-
*/
|
|
63
|
-
xTickLine?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* If `true`, displays tick lines on the y-axis.
|
|
66
|
-
*/
|
|
67
|
-
yTickLine?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Crosshair configuration object for customizing the appearance of the crosshair line.
|
|
70
|
-
*/
|
|
71
|
-
crosshairConfig?: {
|
|
72
|
-
/**
|
|
73
|
-
* The color of the crosshair line. Accepts any valid CSS color string.
|
|
74
|
-
* Example: '#f00', 'rgba(0,0,0,0.5)', 'blue'
|
|
75
|
-
*/
|
|
76
|
-
color?: string;
|
|
77
|
-
/**
|
|
78
|
-
* The stroke color of the crosshair line. Accepts any valid CSS color string.
|
|
79
|
-
*/
|
|
80
|
-
strokeColor?: string;
|
|
81
|
-
/**
|
|
82
|
-
* The stroke width of the crosshair line in pixels.
|
|
83
|
-
*/
|
|
84
|
-
strokeWidth?: number;
|
|
85
|
-
};
|
|
86
|
-
}
|