{"record":{"id":"d1871ac248de2329","repo":"MudBlazor/MudBlazor","slug":"charttype-chart-is-not-supported-d1871a","errorCode":null,"errorMessage":"{ChartType} chart is not supported","messagePattern":"(.+?) chart is not supported","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/MudBlazor/Components/Chart/MudChart.razor.cs","lineNumber":125,"sourceCode":"        ChartType.Sankey => (SankeyChartOptions)options,\n        ChartType.ScatterPlot => (ScatterPlotChartOptions)options,\n        _ => ChartOptions!\n    };\n\n    private IChartOptions GetDefaultOptionsForChart() => ChartType switch\n    {\n        ChartType.Pie => new PieChartOptions(),\n        ChartType.Bar => new BarChartOptions(),\n        ChartType.Line => new LineChartOptions(),\n        ChartType.Donut => new DonutChartOptions(),\n        ChartType.HeatMap => new HeatMapChartOptions(),\n        ChartType.StackedBar => new StackedBarChartOptions(),\n        ChartType.Timeseries => new TimeSeriesChartOptions(),\n        ChartType.Rose => new RoseChartOptions(),\n        ChartType.Radar => new RadarChartOptions(),\n        ChartType.Sankey => new SankeyChartOptions(),\n        ChartType.ScatterPlot => new ScatterPlotChartOptions(),\n        _ => throw new NotImplementedException($\"{ChartType} chart is not supported\")\n    };\n\n    public override void RebuildChart() => ChartReference?.RebuildChart();\n}\n","sourceCodeStart":107,"sourceCodeEnd":130,"githubUrl":"https://github.com/MudBlazor/MudBlazor/blob/bdb3acd5ddc0a563428488e7afef0d99549f7a6c/src/MudBlazor/Components/Chart/MudChart.razor.cs#L107-L130","documentation":"MudChart.razor.cs maps ChartType to the corresponding options type (PieChartOptions, BarChartOptions, etc.) in a switch expression inside the chart options resolver. All declared ChartType members are mapped, so the NotImplementedException is a defensive guard against an out-of-range or unrecognized ChartType value. It is the options-side counterpart to the render-side throw at error 23.","triggerScenarios":"ChartType set to an undefined numeric value; a new ChartType member added without an options mapping; version skew between the enum and the resolver.","commonSituations":"Loading chart config with a stale ChartType integer from an older or newer schema; reflection-based assignment of ChartType; partial library upgrade.","solutions":["Validate ChartType with Enum.IsDefined before constructing the chart.","Default unknown persisted ChartType values to ChartType.Bar on load.","Ensure consistent MudBlazor versions across all referenced projects."],"exampleFix":"// before\nvar type = (ChartType)configInt;\n\n// after\nvar type = Enum.IsDefined(typeof(ChartType), configInt)\n    ? (ChartType)configInt\n    : ChartType.Bar;","handlingStrategy":"validation","validationCode":"var type = Enum.IsDefined(typeof(ChartType), raw) ? (ChartType)raw : ChartType.Bar;","typeGuard":"static bool IsValidChartType(ChartType t) => Enum.IsDefined(typeof(ChartType), t);","tryCatchPattern":null,"preventionTips":["Treat unknown ChartType values as a safe default on load.","Avoid reflection-based assignment of ChartType.","Synchronize library versions across projects."],"tags":["chart","chart-type","enum","switch-exhaustiveness","options"],"backgroundTag":null,"analyzedSha":"bdb3acd5ddc0a563428488e7afef0d99549f7a6c","analyzedAt":"2026-08-13T19:36:54.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}