We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart not rendered in UWP Release mode

I tried to use the SfChart targeting Android and UWP. All works great in Debug mode, but in Release mode the chart is not displayed for UWP. I tried both ARM and x86.
I used the GettingStartedDemo (which was initially targeting Android, iOS and Windows Phone 8.0) but I extended it with a UWP project.
I referenced Syncfusion.SfChart.UWP, Syncfusion.SfChart.XForms and Syncfusion.SfChart.XForms.UWP in the UWP project and I also added the new SfChartRenderer(); in the MainPage() constructor.
The Debug build compiled and run well, but the Release built shows the following warnings:

2>G:\My Documents\Visual Studio 2015\Projects\Chart_GettingStarted\GettingStartedDemo.UWP\sg.exe : warning : SG0002 : Cannot generate serialization code for type 'Syncfusion.UI.Xaml.Charts.SerializableSfChart'
2>G:\My Documents\Visual Studio 2015\Projects\Chart_GettingStarted\GettingStartedDemo.UWP\sg.exe : warning : SG0002 : Cannot generate serialization code for type 'Syncfusion.UI.Xaml.Charts.SerializableWatermark'
etc....

and when running the code, the chart is not displayed

3 Replies

Devi Aruna Maharasi Murugan November 7, 2016 09:48 AM UTC

Hi Paul, 
  
Thanks for contacting Syncfusion Support. 
  
In order to work our Syncfusion components (third party components) in release mode with enabling .Net Native tool chain, we have to include Renderer type assembly as like in the below code snippet.    
  
App.Xaml.cs 
 
List<Assembly> assembliesToInclude = new List<Assembly>(); 
 
assembliesToInclude.Add(typeof(Syncfusion.SfChart.XForms.UWP.SfChartRenderer).GetTypeInfo().Assembly); 
 
Xamarin.Forms.Forms.Init(e , assembliesToInclude); 
 
  
  
We have prepared a demo sample for your reference and it can be downloaded from below link, 
  
Sample: XamarinDemo 
  
Regards, 
Devi 





PV Paul van der stap November 7, 2016 02:22 PM UTC

Thanks Devi,

This worked for me.

Paul

Devi Aruna Maharasi Murugan November 8, 2016 03:33 AM UTC

Hi Paul, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance. 
  
Regards, 
Devi 

Loader.
Live Chat Icon For mobile
Up arrow icon