Skip to content

Commit

Permalink
[@mantine/chart] Fix error when chart tooltip label contains period (#…
Browse files Browse the repository at this point in the history
…6826)

* fix: exception thrown when chart tooltip label has period

* fix: formatting
  • Loading branch information
Jones-Griffin authored Sep 25, 2024
1 parent ca528f2 commit 27716f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@mantine/charts/src/ChartTooltip/ChartTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import classes from './ChartTooltip.module.css';

function updateChartTooltipPayload(payload: Record<string, any>[]): Record<string, any>[] {
return payload.map((item) => {
if (!item.payload || item.payload[item.name]) {
return item;
}
const matchFound = item.name.search(/\./);
if (matchFound >= 0) {
const newDataKey = item.name.substring(0, matchFound);
Expand Down

0 comments on commit 27716f8

Please sign in to comment.