syncfusion / Uno.SfChart

Syncfusion Uno Chart is an easy to use library for building native mobile and WebAssembly apps with C#, XAML from a single codebase. The chart controls offers 10+ chart types namely line, column, area, bar, pie, doughnut, scatter, etc.
Other
19 stars 14 forks source link

[WASM] Exception if SfChart.Behaviors does not contain a ChartSelectionBehavior #18

Open mikernet opened 2 years ago

mikernet commented 2 years ago

If I put a chart on a page (I used BarSeries) without a ChartSelectionBehavior added to SfChart.Behaviors then it crashes on WASM with the following exception:

System.ArgumentNullException: ArgumentNull_Generic Arg_ParamName_Name, source
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) in D:\a\Uno.DotnetRuntime.WebAssembly\Uno.DotnetRuntime.WebAssembly\runtime\src\libraries\System.Linq\src\System\Linq\ThrowHelper.cs:line 12
   at System.Linq.Enumerable.Where[ChartBehavior](IEnumerable`1 source, Func`2 predicate) in D:\a\Uno.DotnetRuntime.WebAssembly\Uno.DotnetRuntime.WebAssembly\runtime\src\libraries\System.Linq\src\System\Linq\Where.cs:line 16
   at Syncfusion.UI.Xaml.Charts.ChartBase.SetSelectionBehaviour() in C:\Users\mikem\Documents\Projects\Uno.SfChart\Src\ChartArea\ChartBase.cs:line 1326
   at Syncfusion.UI.Xaml.Charts.ChartBase.get_SelectionBehaviour() in C:\Users\mikem\Documents\Projects\Uno.SfChart\Src\ChartArea\ChartBase.cs:line 472
   at Syncfusion.UI.Xaml.Charts.SfChart.UpdateArea(Boolean forceUpdate) in C:\Users\mikem\Documents\Projects\Uno.SfChart\Src\ChartArea\ChartArea.cs:line 1128
   at Syncfusion.UI.Xaml.Charts.ChartBase.UpdateArea() in C:\Users\mikem\Documents\Projects\Uno.SfChart\Src\ChartArea\ChartBase.cs:line 1357
   at Windows.UI.Core.CoreDispatcher.InvokeOperationSafe(UIAsyncOperation operation) in C:\a\1\s\src\Uno.UWP\UI\Core\CoreDispatcher.cs:line 337

It does not do this on UWP.

mikernet commented 2 years ago

P.S. Same thing happens if an AreaSeries chart does not have a ChartZoomPanBehavior added.