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

[@mantine/charts] fix: PieChart key error on same data names #6067

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mullwar
Copy link

@mullwar mullwar commented Apr 12, 2024

Fixes PieChart same key error when specifying duplicate names in data (PieChartCell) by introducing optional key prop.

Example:

<PieChart
  withLabels
  withTooltip
  size={200}
  data={[
    { name: 'Group E', value: 100, color: 'red.6' },
    { name: 'Group E', value: 150, color: 'orange.6' },
  ]}
/>

Error:

piechart-key-error

Fixes by passing a new key prop:

<PieChart
  withLabels
  withTooltip
  size={200}
  data={[
    { key: 'e-1', name: 'Group E', value: 100, color: 'red.6' },
    { key: 'e-2', name: 'Group E', value: 150, color: 'orange.6' },
  ]}
/>

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 this pull request may close these issues.

None yet

1 participant