-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[charts-pro] Fix slotProps.tooltip.trigger
not respected in ScatterChartPro
and FunnelChart
#18902
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-pro] Fix slotProps.tooltip.trigger
not respected in ScatterChartPro
and FunnelChart
#18902
Conversation
Deploy preview: https://deploy-preview-18902--material-ui-x.netlify.app/ Bundle size report
|
CodSpeed Performance ReportMerging #18902 will not alter performanceComparing Summary
|
@@ -109,7 +109,7 @@ const FunnelChart = React.forwardRef(function FunnelChart( | |||
<ChartsAxis {...chartsAxisProps} /> | |||
{children} | |||
</ChartsSurface> | |||
{!themedProps.loading && <Tooltip {...themedProps.slotProps?.tooltip} trigger="item" />} | |||
{!themedProps.loading && <Tooltip trigger="item" {...themedProps.slotProps?.tooltip} />} |
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.
Yeah the idea was to remove the possibility of changing it, IMO we could check for trigger={themedProps.slotProps?.tooltip === 'none' ? 'none' : 'item'}
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.
I was considering changing the props so that "axis" isn't a valid option for scatter and funnel. Wouldn't that work as well?
The user can still provide "axis" if they want to, but they can provide any string really.
@@ -22,15 +22,16 @@ import { useSvgRef } from '../hooks'; | |||
|
|||
const noAxis = () => false; | |||
|
|||
export interface ChartsTooltipContainerProps extends Partial<PopperProps> { | |||
export interface ChartsTooltipContainerProps<T extends TriggerOptions = TriggerOptions> | |||
extends Partial<PopperProps> { | |||
/** | |||
* Select the kind of tooltip to display | |||
* - 'item': Shows data about the item below the mouse. | |||
* - 'axis': Shows values associated with the hovered x value |
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.
Now it can also be y values for horizontal bar chart and rotation for radar chart
* - 'axis': Shows values associated with the hovered x value | |
* - 'axis': Shows values associated with the hovered axis value. |
@@ -22,15 +22,16 @@ import { useSvgRef } from '../hooks'; | |||
|
|||
const noAxis = () => false; | |||
|
|||
export interface ChartsTooltipContainerProps extends Partial<PopperProps> { | |||
export interface ChartsTooltipContainerProps<T extends TriggerOptions = TriggerOptions> | |||
extends Partial<PopperProps> { | |||
/** | |||
* Select the kind of tooltip to display | |||
* - 'item': Shows data about the item below the mouse. | |||
* - 'axis': Shows values associated with the hovered x value | |||
* - 'none': Does not display tooltip |
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.
* - 'none': Does not display tooltip | |
* - 'none': Does not display tooltip. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
f39ec4f
to
0788cb7
Compare
0788cb7
to
107f365
Compare
107f365
to
661936e
Compare
Fixes #18900.
Before
See videos in #18900.
After
ScatterChartPro
Screen.Recording.2025-07-24.at.18.15.44.mov
FunnelChart
Screen.Recording.2025-07-24.at.18.15.21.mov