Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Copy link

@github-actions github-actions bot Jan 14, 2026

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-components/Charts-DonutChart 6 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Basic - Dark Mode.default.chromium.png 9043 Changed
vr-tests-react-components/Charts-DonutChart.Basic.default.chromium.png 10058 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png 5882 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 4731 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5883 Changed
vr-tests-react-components/Charts-DonutChart.Basic - RTL.default.chromium.png 10059 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 728 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 868 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled.chromium.png 677 Changed
vr-tests-react-components/TagPicker.disabled - Dark Mode.chromium.png 658 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

"type": "patch",
"comment": "fix chart width issue in donut chart",
"packageName": "@fluentui/react-charts",
"email": "anushgupta@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,37 +337,41 @@ export const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwar
</text>
)}
<div className={classes.chartWrapper} {...arrowAttributes}>
<svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>
<svg
className={classes.chart}
aria-label={data?.chartTitle}
width={_width}
height={_height! + titleHeight / 2}
Copy link
Contributor

Choose a reason for hiding this comment

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

why titleHeight / 2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding titleHeight is increasing distance between legends and donut a lot.
to resolve above issue also (chart shifting downwards), I will transform pie by titleHeight/2, currently it is getting transformed by titleHeight which is increasing the gap

>
{!hideLegend && data?.chartTitle && (
<ChartTitle
title={data.chartTitle}
x={_width! / 2}
y={0}
maxWidth={_width! - 20}
className={classes.chartTitle}
titleStyles={props.titleStyles}
tooltipClassName={classes.svgTooltip}
/>
)}
<g transform={`translate(0, ${titleHeight})`}>
<Pie
width={_width!}
height={_height!}
outerRadius={outerRadius}
innerRadius={props.innerRadius!}
data={chartData!}
onFocusCallback={_focusCallback}
hoverOnCallback={_hoverCallback}
hoverLeaveCallback={_hoverLeave}
uniqText={_uniqText}
onBlurCallback={_onBlur}
activeArc={_getHighlightedLegend()}
focusedArcId={focusedArcId || ''}
href={props.href!}
valueInsideDonut={_toLocaleString(valueInsideDonut)}
showLabelsInPercent={props.showLabelsInPercent}
hideLabels={props.hideLabels}
/>
</g>
<Pie
width={_width!}
height={_height!}
outerRadius={outerRadius}
innerRadius={props.innerRadius!}
data={chartData!}
onFocusCallback={_focusCallback}
hoverOnCallback={_hoverCallback}
hoverLeaveCallback={_hoverLeave}
uniqText={_uniqText}
onBlurCallback={_onBlur}
activeArc={_getHighlightedLegend()}
focusedArcId={focusedArcId || ''}
href={props.href!}
valueInsideDonut={_toLocaleString(valueInsideDonut)}
showLabelsInPercent={props.showLabelsInPercent}
hideLabels={props.hideLabels}
/>
</svg>
</div>
<ChartPopover
Expand Down Expand Up @@ -400,6 +404,7 @@ export const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwar
legendContainer.current = e;
}}
className={classes.legendContainer}
style={{ marginTop: data?.chartTitle ? `-${titleHeight}px` : undefined }}
Copy link
Contributor

Choose a reason for hiding this comment

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

titleHeight

should this not be titleHeight/2

>
{legendBars}
</div>
Expand Down
Loading