Skip to content

Conversation

bernardobelchior
Copy link
Member

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

@bernardobelchior bernardobelchior added type: bug It doesn't behave as expected. scope: charts Changes related to the charts. labels Jul 24, 2025
@mui-bot
Copy link

mui-bot commented Jul 24, 2025

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

Bundle size report

Bundle Parsed Size Gzip Size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid/DataGrid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro/DataGridPro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium/DataGridPremium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro ▼-6B(0.00%) ▼-5B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 661936e

Copy link

codspeed-hq bot commented Jul 24, 2025

CodSpeed Performance Report

Merging #18902 will not alter performance

Comparing bernardobelchior:fix-tooltip-trigger-none (661936e) with master (d0c25ca)

Summary

✅ 10 untouched benchmarks

@@ -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} />}
Copy link
Member

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'}

Copy link
Member Author

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
Copy link
Member

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

Suggested change
* - '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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* - 'none': Does not display tooltip
* - 'none': Does not display tooltip.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 30, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@bernardobelchior bernardobelchior force-pushed the fix-tooltip-trigger-none branch from f39ec4f to 0788cb7 Compare August 1, 2025 07:55
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 1, 2025
@bernardobelchior bernardobelchior force-pushed the fix-tooltip-trigger-none branch from 0788cb7 to 107f365 Compare August 4, 2025 08:35
@bernardobelchior bernardobelchior enabled auto-merge (squash) August 4, 2025 13:25
@bernardobelchior bernardobelchior force-pushed the fix-tooltip-trigger-none branch from 107f365 to 661936e Compare August 4, 2025 13:37
@bernardobelchior bernardobelchior merged commit 84d7fb4 into mui:master Aug 4, 2025
21 checks passed
@bernardobelchior bernardobelchior deleted the fix-tooltip-trigger-none branch August 4, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: charts Changes related to the charts. type: bug It doesn't behave as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[charts] Cannot set tooltip trigger to "none" in scatter chart pro and funnel chart
4 participants