|
<SfChart>
<ChartPrimaryXAxis LabelFormat="dd MMM yyyy" ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime">
</ChartPrimaryXAxis>
</SfChart> |
Hi There
When the Chart X-Axis ValueType is "Syncfusion.Blazor.Charts.ValueType.DateTime" and the Chart Selection Mode
is any value except NONE, weird things happen:
2021-06-23 15:34:41.522 +12:00 [WRN] Unhandled exception rendering component: Invalid cast from 'Double' to 'DateTime'.System.InvalidCastException: Invalid cast from 'Double' to 'DateTime'. at System.Double.System.IConvertible.ToDateTime(IFormatProvider provider) at Syncfusion.Blazor.Charts.Selection.SelectionComplete(ChartSelectedDataIndex index, SelectionMode selectionMode) at Syncfusion.Blazor.Charts.Selection.PerformSelection(ChartSelectedDataIndex index, String elementId) at Syncfusion.Blazor.Charts.Selection.selectDataIndex(List`1 indexes) at Syncfusion.Blazor.Charts.Selection.RedrawSelection(SelectionMode oldMode) at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)
The workaround is to use SelectionMode.None
<SfChart @ref="@MyChart" SelectionMode="Syncfusion.Blazor.Charts.SelectionMode.None" >