RadzenChart / RadzenDonutSeries exception when tooltip shown

Hi,
I have a frequent exception using this chart. It looks like when data are updated and it's tooltip is shown, I have the exception below and crash the full page. (at least with Blasor Server-side with Radzen 3.5.2).

<RadzenChart>
	<RadzenDonutSeries Data="@line.Items" 
              CategoryProperty="Label" ValueProperty="NbTasks" Y="45" X="97" Radius="60" 
              InnerRadius="30" Fills="ChartColors">
		<TitleTemplate>
			<div class="rz-donut-content">
				<div>Line @line.LineNum</div>
			</div>
		</TitleTemplate>
		<TooltipTemplate Context="data">
			<div>
				@data.Label: @data.NbTasks
			</div>
		</TooltipTemplate>
	</RadzenDonutSeries>
	<RadzenLegend Visible="false" />
</RadzenChart>


2021-06-16 12:20:26 +02:00 [WRN] Unhandled exception rendering component: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.SZArrayHelper.get_Item[T](Int32 index)
   at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at Radzen.Blazor.RadzenPieSeries`1.TooltipStyle(TItem item)
   at Radzen.Blazor.CartesianSeries`1.<>c__DisplayClass67_0.<RenderTooltip>b__0(RenderTreeBuilder builder)
   at Radzen.Blazor.RadzenChart.<BuildRenderTree>b__0_2(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
2021-06-16 12:20:26 +02:00 [ERR] Unhandled exception in circuit 'B5UGOhUg3lO4XHNTx6xcl4KqKvLQwkL8DK80qzur9KQ'.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.SZArrayHelper.get_Item[T](Int32 index)
   at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at Radzen.Blazor.RadzenPieSeries`1.TooltipStyle(TItem item)
   at Radzen.Blazor.CartesianSeries`1.<>c__DisplayClass67_0.<RenderTooltip>b__0(RenderTreeBuilder builder)
   at Radzen.Blazor.RadzenChart.<BuildRenderTree>b__0_2(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

This isn't a known issue. Can you reproduce it in our online demo or provide a minimal reproduction?

1 Like

It's fine on the demo since data are not updated.

I was able to reproduce the issue within a small project.
https://1drv.ms/u/s!AiyTR-SmI-41kehWYJGuXlZwEKBq1g?e=g1hr8T

Just start and leave your cursor on the chart.

Thank you @Grinwald. We were able to reproduce the problem and will fix it with the next version of Radzen.Blazor.

1 Like