mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

Exception when PieChart or DonutChart tooltip label contains a `.` #6825

Closed samcarton closed 1 month ago

samcarton commented 2 months ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.12.2

What package has an issue?

@mantine/charts

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

repro:

import { PieChart } from '@mantine/charts';

function Demo() {
  return (
    <PieChart
      data={[
        { name: 'USA.com', value: 400, color: 'blue' },
        { name: 'Other', value: 200, color: 'gray.6' },
      ]}
      withTooltip
      w={200}
      h={200}
    />
  );
}

I also tried using label with a . and a sanitized name on the data but the ChartTooltip doesn't use the getSeriesLabels util since there's no "series" passed in.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/busy-wind-6p7vh4

Possible fix

No response

Self-service