Skip to content

fix(react-charting): Improve legend selection for Scatter charts #34701

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srmukher
Copy link
Contributor

Work item: https://uifabric.visualstudio.com/iss/_workitems/edit/13025
fix(react-charting): Improve legend selection for Scatter charts

@srmukher srmukher requested a review from a team as a code owner June 23, 2025 08:26
Copy link

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@@ -0,0 +1,7 @@
{

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests/react-charting-AreaChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-AreaChart.Custom Accessibility.default.chromium.png 11 Changed

@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix(react-charting): Improve legend selection for Scatter charts",
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve

Call this "fix"

setSelectedLegends(props.legendProps?.selectedLegends || []);
}
} else {
setSelectedLegends(props.legendProps?.selectedLegends || []);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any difference in if and else condition statements

return selectedLegends.length === 0;
}, [selectedLegends]);
return selectedLegends.length === 0 && activeLegend === '';
}, [selectedLegends, activeLegend]);
Copy link
Contributor

Choose a reason for hiding this comment

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

use _getHighlightedLegend.length === 0?

@@ -358,8 +359,8 @@ export const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = Rea
* This function checks if none of the legends is selected or hovered.*/

const _noLegendHighlighted = React.useCallback((): boolean => {
Copy link
Contributor

Choose a reason for hiding this comment

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

does this fix issue of legend hover not working also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants