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] Fix Tooltip crash with out of range lines #11898

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Feb 1, 2024

Fix #11893

If some series stop earlier, the default tooltip called the formatter with undefined which was no handled by the default formatter.

I tried to improve the typing, but not that much a success

@alexfauquette alexfauquette added bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! labels Feb 1, 2024
@alexfauquette alexfauquette requested a review from LukasTy February 1, 2024 11:06
@alexfauquette alexfauquette added the needs cherry-pick The PR should be cherry-picked to master after merge label Feb 1, 2024
@mui-bot
Copy link

mui-bot commented Feb 1, 2024

Deploy preview: https://deploy-preview-11898--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 8f39c97

Comment on lines 36 to 39
{series
.filter((item): item is ChartSeriesDefaultized<CartesianChartSeriesType> =>
['bar', 'line', 'scatter'].includes(item.type),
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: WDYT, would it make sense to extract it into a variable outside of JSX? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good idea. I also did it for the container

@alexfauquette alexfauquette merged commit 8bca35f into mui:next Feb 1, 2024
17 checks passed
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
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! needs cherry-pick The PR should be cherry-picked to master after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Charts demo ConnectNulls crashes
3 participants