Skip to content

MudChart: Chart Type Unification + 2 New Charts#11458

Merged
danielchalmers merged 162 commits intoMudBlazor:devfrom
Anu6is:Chart-Rework
Nov 23, 2025
Merged

MudChart: Chart Type Unification + 2 New Charts#11458
danielchalmers merged 162 commits intoMudBlazor:devfrom
Anu6is:Chart-Rework

Conversation

@Anu6is
Copy link
Contributor

@Anu6is Anu6is commented Jun 6, 2025

Description

This PR addresses several inconsistencies within the current charting implementation to hopefully simply future development.

  • Chart options were a bit messy, mixing ChartOptions, AxisChartOptions and base chart properties. Making customization inconsistent.
  • Data input varied between chart types, some used raw double[], others had custom structs.
  • The old base class hierarchy (MudCategoryChartBase, etc.) didn’t clearly separate radial vs. axis charts, making extension difficult.
  • Label parameters like XAxisLabels and InputLabels were named differently across charts even though they served the same purpose.
  • Series visibility toggling was technically configurable for all charts but wasn't functional on all.

Resolves: #8902
Resolves: #8864
Resolves: #7199
Resolves: #7056
Resolves: #5688
Resolves: #5279
Resolves: #11109
Resolves: #10278
Resolves: #10663
Resolves: #11990

Dynamic.Charts.mp4

Mixed Chart

Breaking Changes

Removed Replacement
AxisChartOptions, ChartOptions Specific options: BarChartOptions, LineChartOptions, etc.
MudTimeSeriesChart <MudChart ChartType="ChartType.Timeseries"> or <TimeSeries ... \>
MudCategoryChartBase MudAxisChartBase, MudRadialChartBase
MudCategoryAxisChartBase MudAxisChartBase
TimeSeriesChartSeries ChartSeries + ChartData

Old Parameter New Parameter Applies To
XAxisLabels ChartLabels All Chart Types
XAxisChartOptions xxChartOptions (BarChartOptions, PieChartOptions, LineChartOptions, etc) All Chart Types
InputData ChartSeries Pie, Donut Charts
InputLabels ChartLabels Pie, Donut Charts
CircleDonutRatio DonutRingRatio DonutChartOptions
StackedBarWidthRatio BarWidthRatio StackedBarOptions
DataMarkerTooltipTitleFormat TooltipTitleFormat ChartSeries
ShowDataMarkers ShowDataMarkers Moved to Line and TimeSeries Options
LineDisplayType LineDisplayType Moved to SeriesDisplayOverrides (Line and TimeSeries Options)
FillOpacity FillOpacity Moved to SeriesDisplayOverrides and DefaultRadialChartOptions
TimeSeriesChartSeries.TimeValue TimeValue TimeSeries ChartData
NodeChartOptions SankeyChartOptions Sankey Chart
Nodes & Edges ChartSeries Sankey Chart

Nodes no longer need to be explicitly defined. They are generated based on the edges provided.

BarChartOptions, LineChartOptions, HeatMapChartOptions, DonutChartOptions, PieChartOptions, StackedBarChartOptions RadarChartOptions, RoseChartOptions, TimeSeriesChartOptions, SankeyChartOptions


Data Model Migration

  • Replace direct arrays (double[]) with ChartData
  • Replace TimeSeriesChartSeries with ChartSeries

Example

// OLD 
<MudTimeSeriesChart 
          ChartSeries="@series" 
          AxisChartOptions="@axisChartOptions"/>

// NEW 
<MudChart ChartType="ChartType.Timeseries" 
          ChartSeries="@series" 
          ChartOptions="@timeSeriesOptions" />

Tip

An AsChartDataSet extension method was added to transform an array (T[]) into a List<ChartSeries<T>> for easy Pie Chart migrations

New Features

✅ Show values within Pie Chart segments
✅ Bar and Stacked Bar Chart justification options
✅ Combination Charts (e.g. Bar + Line overlay) - applies to Axis charts ONLY
✅ Interchangeable Charts - all chart types can be converted to other chart types
✅ Tooltip customization (TooltipTemplate, TooltipPositionFunc)

📈 New Chart Types

✅ Radar Chart (ChartType.Radar)
✅ Rose Chart (ChartType.Rose)
✅ Mixed/Combination Charts

Enhancements

✨ White tooltip text with black stroke + drop shadow (better visibility)
✨ Series visibility toggling for all chart types
✨ Stacked Bar charts support negative values
✨ Dynamic chart scaling on visibility changes
✨ Dynamic font scaling for HeatMap cell values
HeatMap tooltips match style of other chart tooltips
INumber<T> support - no longer restricted to double values

How Has This Been Tested?

Visually - Test view and docs
Unit test updates

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library refactor Reorganizes code and has no changes to the API or functionality in the main library

Projects

None yet

5 participants