Render with empty list for datasource

Hello,


I am working  on Syncfusion 19.3.0.57, i want to create a Chart in polar type and with column drawtype. When i start my page, the list for datasource is empty and i receive an error. Is it logic or an error ?


crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      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.Collections.Generic.List`1[[Syncfusion.Blazor.Charts.Chart.Internal.Point, Syncfusion.Blazor, Version=19.3.0.57, Culture=neutral, PublicKeyToken=null]].get_Item(Int32 index)
   at Syncfusion.Blazor.Charts.Internal.PolarColumnSeriesRenderer.ColumnDrawTypeRender(ChartSeries series, ChartAxis x_Axis, ChartAxis y_Axis)
   at Syncfusion.Blazor.Charts.Internal.PolarColumnSeriesRenderer.RenderSeries()
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRenderer.SeriesRenderer()
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRenderer.HandleChartSizeChange(Rect rect)
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRendererContainer.HandleChartSizeChange(Rect rect)
   at Syncfusion.Blazor.Charts.SfChart.PerformLayout()
   at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)



<SfChart @ref="@Chart" Theme="@(_ThemeState.Value.Theme)" CustomClass="chart-in-panel">          
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartPrimaryYAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Double" Minimum="0" Maximum="@max" />
<ChartTooltipSettings Enable="true"></ChartTooltipSettings>
<ChartSeriesCollection>
<ChartSeries DataSource="@visitesSites" XName="Nom" YName="@type" Type="ChartSeriesType.Polar" DrawType="ChartDrawType.Column" Fill="#04AB11" PointColorMapping="Color">        
</ChartSeries>    
</ChartSeriesCollection>
</SfChart>

@code {
private List<Cat> visitesSites = new();
class Cat
    {
        public int IdxCategorie { get; set; }
        public string Nom { get; set; }
        public int Count { get; set; }
        public double TempsMoyen { get; set; }
        public double TempsTotal { get; set; }
        public string Color { get; set; }
    }

3 Replies 1 reply marked as answer

GB Geraud Bertrand December 14, 2021 09:23 AM UTC

I did test and see error appear when i set the Type to ChartSeriesType.Polar.

I think there could be an error here.



DG Durga Gopalakrishnan Syncfusion Team December 14, 2021 04:19 PM UTC

Hi Geraud, 

Greetings from Syncfusion. 

We have validated your reported scenario with attached exception. We have logged defect report for this issue. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 28th December 2021. We appreciate your patience until then. You can keep track of the bug from the below feedback link. 


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal. 

Regards,  
Durga G 



DG Durga Gopalakrishnan Syncfusion Team December 28, 2021 02:04 PM UTC

Hi Geraud, 

We are glad to announce that our v19.4.40 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor NuGet package version.  


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

Regards, 
Durga G 


Marked as answer
Loader.
Up arrow icon