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

[Charts] Barchart with empty dataset should render an empty chart #12462

Closed
Janpot opened this issue Mar 15, 2024 · 2 comments · Fixed by #12708
Closed

[Charts] Barchart with empty dataset should render an empty chart #12462

Janpot opened this issue Mar 15, 2024 · 2 comments · Fixed by #12708
Assignees
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!

Comments

@Janpot
Copy link
Member

Janpot commented Mar 15, 2024

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-vvrvzj?file=Demo.tsx

Steps:

  1. open demo

Current behavior

Error in /turbo_modules/@mui/[email protected]/BarChart/extremums.js (22:36)
undefined is not iterable (cannot read property Symbol(Symbol.iterator))

Expected behavior

An empty chart is shown, as if series={[]}

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: empty barchart

@Janpot Janpot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 15, 2024
@zannager zannager added the component: charts This is the name of the generic UI component, not the React module! label Mar 15, 2024
@nivb52
Copy link

nivb52 commented Mar 19, 2024

It seems you need at list one item in the array -

const dataset = [{}];

p.s
it does break the DatasetType

export type DatasetType<T = number | string | Date | null | undefined> = DatasetElementType<T>[];

@alexfauquette alexfauquette added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 19, 2024
@JCQuintas JCQuintas self-assigned this Apr 8, 2024
Copy link

github-actions bot commented Apr 9, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@Janpot: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants