From 0abfcb1cbf3238d505ee813345c892e78d196393 Mon Sep 17 00:00:00 2001 From: mullwar Date: Fri, 12 Apr 2024 14:48:22 +0300 Subject: [PATCH] [@mantine/charts] fix: PieChart key error on same data names --- .../charts/src/ChartTooltip/ChartTooltip.tsx | 2 +- .../charts/src/PieChart/PieChart.story.tsx | 14 ++++++++++++-- packages/@mantine/charts/src/PieChart/PieChart.tsx | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/@mantine/charts/src/ChartTooltip/ChartTooltip.tsx b/packages/@mantine/charts/src/ChartTooltip/ChartTooltip.tsx index 8c6fbf55a26..4686a224307 100644 --- a/packages/@mantine/charts/src/ChartTooltip/ChartTooltip.tsx +++ b/packages/@mantine/charts/src/ChartTooltip/ChartTooltip.tsx @@ -123,7 +123,7 @@ export const ChartTooltip = factory((_props, ref) => { const _label = label || scatterLabel; const items = filteredPayload.map((item) => ( -
+
+ +
+ ); +} + export function Semicircle() { return (
diff --git a/packages/@mantine/charts/src/PieChart/PieChart.tsx b/packages/@mantine/charts/src/PieChart/PieChart.tsx index bb2dc7b824a..c5d34524620 100644 --- a/packages/@mantine/charts/src/PieChart/PieChart.tsx +++ b/packages/@mantine/charts/src/PieChart/PieChart.tsx @@ -29,6 +29,7 @@ import { ChartTooltip } from '../ChartTooltip/ChartTooltip'; import classes from './PieChart.module.css'; export interface PieChartCell { + key?: string | number; name: string; value: number; color: MantineColor;