MudChart: Fix Radial Chart Issues#12685
Conversation
- Fix radial chart legend logic
There was a problem hiding this comment.
Pull request overview
This PR fixes two visual issues in MudBlazor radial charts (Pie, Donut, Rose, and Radar charts):
-
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
CanHideSeriesis enabled to allow user interaction. -
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
CanHideSeriesis 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.
There was a problem hiding this comment.
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.
|
@Anu6is lmk if you wanna ignore those copilot comments or not and i'll merge |
|
@Anu6is Is this ready to merge? |
|
It is |
|
Thank you! |
Fix radial chart legend logic
CanHideSeriesis enabled to allow the user to show/hide.Fix radar label position
Partially addresses #12669
Checklist: