RadzenSeriesDataLabels Error

I'm displaying the data labels for a chart. This works correctly when the page is loaded initially, but every subsequent load throws an error. Including markup and error. Not sure what I'm missing here. The error goes away when I remove the RadzenSeriesDataLabels tag.

        <RadzenColumnSeries Data="@reasonCodes" CategoryProperty="Name" ValueProperty="Percent" Fill="#3A75ED">
            <RadzenSeriesDataLabels Visible="true"></RadzenSeriesDataLabels>
        <RadzenValueAxis FormatString="{0:0%}" Step=".20" Max=".5">
            <RadzenGridLines Visible="true" LineType="LineType.Dashed" />
        <RadzenCategoryAxis FormatString="{0:0%}"></RadzenCategoryAxis>
        <RadzenLegend Visible="false" />
        <RadzenChartTooltipOptions Visible="false" />
        <RadzenColumnOptions Radius="8"  /> 

Throws error:
blazor.server.js:1 [2024-06-05T17:13:25.850Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Radzen.Blazor.RadzenColumnSeries1.GetDataLabels(Double offsetX, Double offsetY) at Radzen.Blazor.RadzenSeriesDataLabels.<Render>b__17_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at Radzen.Blazor.CartesianSeries1.<>c__DisplayClass71_0.b__0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Radzen.Blazor.RadzenChart.b__113_2(RenderTreeBuilder __builder2)
at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

Hi @btrueax,

Can you provide some steps to reproduce the problem? It could be related to the contents of the reasonCodes collection.

The data itself looks like this:
Data is loaded from this method.

Could you try this:

<RadzenChart Visible=@(reasonCodes != null)> <!-- rest -->

Sorry for the delay. So with that change, it appears that reasonCodes is null, since my barchart is not visible. Perhaps I'm not binding the data in the correct method. Or I need to add some null checking somewhere.

UPDATE: I moved my code to OnAfterRenderAsync and that appears to be working now. Thank you!