-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[charts] Fix Tooltip crash with out of range lines #11898
Conversation
Deploy preview: https://deploy-preview-11898--material-ui-x.netlify.app/ |
{series | ||
.filter((item): item is ChartSeriesDefaultized<CartesianChartSeriesType> => | ||
['bar', 'line', 'scatter'].includes(item.type), | ||
) |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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
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