[WEB-3035] chore: add labels to treemap chart (#6313)
This commit is contained in:
parent
2622dd691c
commit
c1407daa47
2 changed files with 4 additions and 1 deletions
1
packages/types/src/charts.d.ts
vendored
1
packages/types/src/charts.d.ts
vendored
|
|
@ -35,6 +35,7 @@ export type TStackedBarChartProps<K extends string, T extends string> = {
|
|||
export type TreeMapItem = {
|
||||
name: string;
|
||||
value: number;
|
||||
label?: string;
|
||||
textClassName?: string;
|
||||
icon?: React.ReactElement;
|
||||
} & (
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export const CustomTreeMapContent = ({
|
|||
height,
|
||||
name,
|
||||
value,
|
||||
label,
|
||||
fillColor,
|
||||
fillClassName,
|
||||
textClassName,
|
||||
|
|
@ -109,10 +110,11 @@ export const CustomTreeMapContent = ({
|
|||
x={pX + TEXT_PADDING_LEFT}
|
||||
y={pY + pHeight - TEXT_PADDING_LEFT}
|
||||
textAnchor="start"
|
||||
className={cn("text-xs", textClassName || "text-custom-text-300")}
|
||||
className={cn("text-xs font-light tracking-wider", textClassName || "text-custom-text-300")}
|
||||
fill="currentColor"
|
||||
>
|
||||
{value?.toLocaleString()}
|
||||
{label && ` ${label}`}
|
||||
</text>
|
||||
</g>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue