Hello, how to rerender chart when data collection changed ? I use List and can render chart just once and only if data collection is assigned with data in my razor page/component initialization method. Tables and Datagrids are rerendered correctly.
Hi @marekzak,
Can you elaborate? The Radzen Blazor Chart will update as series if its Data property changes by reference. If you only update an item from the list it won't change.
I tried to pass Chart Data property by reference but there is no difference.
Do you mean like this ?
Click="args => AddToList(ref revenue2019)"
.
.
<RadzenLineSeries Data="revenue2019" .... />
.
.
private void AddToList(ref List<DataItem> data)
{
data.Add(new DataItem (.....) );
}
It works fine, great.
I had a scaling issue, unfortunatelly on both axis, so did not see it.
Please give an example how to update Chart Data property changes by reference!
Something like:
data.Add(new DataItem());
// Create a new reference thus updating the existing data property
data = data.ToList();