feat: introduced stacked bar chart and tree map chart. (#6305)
This commit is contained in:
parent
873e4330bc
commit
d6bcd8dd15
10 changed files with 460 additions and 0 deletions
53
packages/types/src/charts.d.ts
vendored
Normal file
53
packages/types/src/charts.d.ts
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
export type TStackItem<T extends string> = {
|
||||
key: T;
|
||||
fillClassName: string;
|
||||
textClassName: string;
|
||||
dotClassName?: string;
|
||||
showPercentage?: boolean;
|
||||
};
|
||||
|
||||
export type TStackChartData<K extends string, T extends string> = {
|
||||
[key in K]: string | number;
|
||||
} & Record<T, any>;
|
||||
|
||||
export type TStackedBarChartProps<K extends string, T extends string> = {
|
||||
data: TStackChartData<K, T>[];
|
||||
stacks: TStackItem<T>[];
|
||||
xAxis: {
|
||||
key: keyof TStackChartData<K, T>;
|
||||
label: string;
|
||||
};
|
||||
yAxis: {
|
||||
key: keyof TStackChartData<K, T>;
|
||||
label: string;
|
||||
domain?: [number, number];
|
||||
allowDecimals?: boolean;
|
||||
};
|
||||
barSize?: number;
|
||||
className?: string;
|
||||
tickCount?: {
|
||||
x?: number;
|
||||
y?: number;
|
||||
};
|
||||
showTooltip?: boolean;
|
||||
};
|
||||
|
||||
export type TreeMapItem = {
|
||||
name: string;
|
||||
value: number;
|
||||
textClassName?: string;
|
||||
icon?: React.ReactElement;
|
||||
} & (
|
||||
| {
|
||||
fillColor: string;
|
||||
}
|
||||
| {
|
||||
fillClassName: string;
|
||||
}
|
||||
);
|
||||
|
||||
export type TreeMapChartProps = {
|
||||
data: TreeMapItem[];
|
||||
className?: string;
|
||||
isAnimationActive?: boolean;
|
||||
};
|
||||
1
packages/types/src/index.d.ts
vendored
1
packages/types/src/index.d.ts
vendored
|
|
@ -37,3 +37,4 @@ export * from "./command-palette";
|
|||
export * from "./timezone";
|
||||
export * from "./activity";
|
||||
export * from "./epics";
|
||||
export * from "./charts";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue