Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
samcarton opened this issue Sep 16, 2024 · 0 comments · Fixed by #6826
Closed
1 of 2 tasks

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

samcarton opened this issue Sep 16, 2024 · 0 comments · Fixed by #6826

Comments

@samcarton
Copy link

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

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

  • When PieChart or DonutChart data has a name that contains a . it will throw the following exception:
  • TypeError: Cannot read properties of undefined from updateChartTooltipPayload in ChartTooltip

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

  • I would be willing to implement a fix for this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant