Refresh chart when a series is removed

Removing a series from the chart only dropped it from the Series list
without rebuilding the category/value scales. When a RadzenChart
instance was reused across a render that replaced its series, new
series' Data callbacks would refresh the scale while the outgoing
series were still present, and after they were finally disposed the
scale kept the stale categories. Triggering a refresh on removal
rebuilds the scales from the live series set.
This commit is contained in:
Atanas Korchev
2026-04-24 13:04:09 +03:00
committed by Vladimir Enchev
parent 48d1f6fdac
commit 9709375d9e

View File

@@ -314,7 +314,10 @@ namespace Radzen.Blazor
internal void RemoveSeries(IChartSeries series)
{
Series.Remove(series);
if (Series.Remove(series))
{
_ = Refresh(false);
}
}
/// <summary>
/// Returns the Series used by the Chart.