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.
Unfortunately, activation email could not send to your email. Please try again.

Chart not rendered in UWP Release mode

Thread ID:

Created:

Updated:

Platform:

Replies:

127258 Nov 4,2016 12:36 PM Nov 7,2016 10:33 PM UWP 3
loading
Tags: SfChart
Paul van der stap
Asked On November 4, 2016 12:36 PM

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

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On November 7, 2016 04:48 AM

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 





Paul van der stap
Replied On November 7, 2016 09:22 AM

Thanks Devi,

This worked for me.

Paul

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On November 7, 2016 10:33 PM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;