[charts][PieChart] prop.slots
and prop.slotProps
not passed to <ChartsTooltip />
#12926
Labels
bug 🐛
Something doesn't work
component: charts
This is the name of the generic UI component, not the React module!
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
Implementationmui-x/packages/x-charts/src/PieChart/PieChart.tsx
Line 186 in 2b4a75d
BarChart
andLineChart
Implementationmui-x/packages/x-charts/src/BarChart/BarChart.tsx
Line 201 in 2b4a75d
mui-x/packages/x-charts/src/LineChart/LineChart.tsx
Line 230 in 2b4a75d
ScatterChart
ImplementationThe
ScatterChart
also appears to have this issue.mui-x/packages/x-charts/src/ScatterChart/ScatterChart.tsx
Line 175 in 2b4a75d
Your environment
npx @mui/envinfo
Search keywords: tooltip, slots, slotProps, piechart
The text was updated successfully, but these errors were encountered: