[WEB-3035] chore: add labels to treemap chart (#6313)

This commit is contained in:
Prateek Shourya
2025-01-03 20:03:11 +05:30
committed by GitHub
parent 2622dd691c
commit c1407daa47
2 changed files with 4 additions and 1 deletions

View File

@@ -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;
} & (

View File

@@ -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>
);