Closed tonytino closed 2 weeks ago
@JCQuintas can you please handle this one?
:warning: 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.
@tonytino: 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.
Steps to reproduce
Link to live non-working example (PieChart): https://codesandbox.io/p/sandbox/sleepy-greider-xyc9w2?file=%2Fsrc%2FDemo.tsx%3A46%2C36 Link to live working example (BarChart): https://codesandbox.io/p/sandbox/affectionate-thompson-whdvs2?file=%2Fsrc%2FDemo.tsx%3A9%2C12
Steps:
<PieChart />
slots={{ itemContent: CustomComponent}}
andtooltip={{ trigger: 'item' }}
Current behavior
Default tooltip renders
Expected behavior
Custom tooltip renders
Context
Leverage a custom tooltip for a basic
<PieChart />
implementation (i.e. not composition-based).The
PieChart
documentation suggests that it should be possible to override the default tooltip by passing a custom component toslots.itemContent
. However, as of v7.3.1, this is still not having any impact on the rendering of the tooltip.This appears to be due to the necessary props not being passed along to enable this behavior within
PieChart.tsx
specifically.PieChart
Implementationhttps://github.com/mui/mui-x/blob/2b4a75d7c9c6e6c1e06919b104f642bcdb0c1b35/packages/x-charts/src/PieChart/PieChart.tsx#L186
BarChart
andLineChart
Implementationhttps://github.com/mui/mui-x/blob/2b4a75d7c9c6e6c1e06919b104f642bcdb0c1b35/packages/x-charts/src/BarChart/BarChart.tsx#L201
https://github.com/mui/mui-x/blob/2b4a75d7c9c6e6c1e06919b104f642bcdb0c1b35/packages/x-charts/src/LineChart/LineChart.tsx#L230
ScatterChart
ImplementationThe
ScatterChart
also appears to have this issue.https://github.com/mui/mui-x/blob/2b4a75d7c9c6e6c1e06919b104f642bcdb0c1b35/packages/x-charts/src/ScatterChart/ScatterChart.tsx#L175
Your environment
``` System: OS: macOS 14.3 Binaries: Node: 18.20.0 - ~/.nvm/versions/node/v18.20.0/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v18.20.0/bin/npm pnpm: Not Found Browsers: Chrome: 124.0.6367.93 Edge: Not Found Safari: 17.3 npmPackages: @emotion/react: 11.11.4 => 11.11.4 @emotion/styled: 11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.34 @mui/core-downloads-tracker: 5.15.14 @mui/icons-material: 5.15.7 => 5.15.7 @mui/material: 5.15.7 => 5.15.7 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/system: 5.15.14 @mui/types: 7.2.14 @mui/utils: 5.15.7 => 5.15.7 @mui/x-charts: 7.3.1 => 7.3.1 @mui/x-data-grid: 6.19.10 => 6.19.10 @mui/x-date-pickers: 6.19.9 => 6.19.9 @types/react: 18.2.39 => 18.2.39 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 typescript: 5.3.3 => 5.3.3 ```npx @mui/envinfo
Search keywords: tooltip, slots, slotProps, piechart