Skip to content

MudChart: Fix Radial Chart Issues#12685

Merged
danielchalmers merged 6 commits intoMudBlazor:devfrom
Anu6is:RadialChartFix
Feb 19, 2026
Merged

MudChart: Fix Radial Chart Issues#12685
danielchalmers merged 6 commits intoMudBlazor:devfrom
Anu6is:RadialChartFix

Conversation

@Anu6is
Copy link
Contributor

@Anu6is Anu6is commented Feb 18, 2026

Fix radial chart legend logic

  • Radial charts displayed all available legend items even if the data series item is not currently visible. This should only be the case when CanHideSeries is enabled to allow the user to show/hide.

Fix radar label position

  • Radar chart value labels were positions on top of the chart grid but behind the data paths. Depending on the opacity of the paths, the values could potentially be hidden.

Partially addresses #12669

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

- Fix radial chart legend logic
@mudbot mudbot bot added the bug Unexpected behavior or functionality not working as intended label Feb 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes two visual issues in MudBlazor radial charts (Pie, Donut, Rose, and Radar charts):

  1. Legend filtering logic: Previously, radial charts displayed all legend items even when the corresponding data points were not visible. The fix ensures legends only show items that have actual rendered paths, unless CanHideSeries is enabled to allow user interaction.

  2. Radar chart label positioning: Radar chart value labels were rendered behind the data paths, potentially being hidden by opaque paths. The fix moves axis labels to a separate rendering pass after data paths are drawn.

Changes:

  • Fixed legend visibility logic in radial charts to only show items with actual data unless CanHideSeries is true
  • Refactored radar chart rendering to properly layer axis labels above data paths
  • Added safety guard for stepValue calculation to prevent division issues

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/MudBlazor/Components/Chart/Base/MudRadialChartBase.cs Updated BuildLegends to filter legends based on whether paths exist and CanHideSeries setting
src/MudBlazor/Components/Chart/Base/BaseRadialChart.razor.cs Added ChartAxisLabels parameter to support separate rendering of axis labels
src/MudBlazor/Components/Chart/Base/BaseRadialChart.razor Renders ChartAxisLabels after data paths to ensure proper layering
src/MudBlazor/Components/Chart/Charts/Radar.razor.cs Added safety guard to ensure stepValue is at least 1 to prevent division issues
src/MudBlazor/Components/Chart/Charts/Radar.razor Refactored axis label rendering into separate RenderAxisLabels method for better layering
src/MudBlazor.UnitTests/Components/Charts/RoseChartTests.cs Updated test expectation from 3 to 2 legend items to match new filtering behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielchalmers
Copy link
Member

@Anu6is lmk if you wanna ignore those copilot comments or not and i'll merge

@danielchalmers
Copy link
Member

@Anu6is Is this ready to merge?

@Anu6is
Copy link
Contributor Author

Anu6is commented Feb 19, 2026

It is

@danielchalmers danielchalmers merged commit 2c6bff7 into MudBlazor:dev Feb 19, 2026
11 checks passed
@danielchalmers
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended regression Previously worked and now doesn't

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants