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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NullReferenceException When Create DoughnutSeries / PieSeries

Thread ID:

Created:

Updated:

Platform:

Replies:

150083 Dec 19,2019 03:31 PM UTC Dec 23,2019 06:02 AM UTC Xamarin.Android 4
loading
Tags: SfChart
Ooi Keng Siang
Asked On December 19, 2019 03:31 PM UTC

var series = new Com.Syncfusion.Charts.DoughnutSeries();
With a simple one line of code above, DoughnutSeries / PieSeries is crashing on Xamarin.Android with the following stack trace:
System.NullReferenceException: Object reference not set to an instance of an object.
SfChartResources.GetString (System.Globalization.CultureInfo culture, System.String text, System.Int32 resourceID) SfChartResources.get_Others ()
Com.Syncfusion.Charts.CircularSeries..ctor () [0x0008c] in <23b7b85cad50489abf0f061166792c75>:0
Com.Syncfusion.Charts.PieSeries..ctor () [0x00000] in <23b7b85cad50489abf0f061166792c75>:0
Com.Syncfusion.Charts.DoughnutSeries..ctor () [0x0004e] in <23b7b85cad50489abf0f061166792c75>:0

BarSeries and ColumnSeries can initialized without any problem on Xamarin.Android.
I tested on Android 6 and with Syncfusion.Xamarin.SfChart.Android version 17.4.0.39 nuget package.
I tried to use a few previous / older version, but they all also have the same problem on DoughnutSeries / PieSeries.


Ooi Keng Siang
Replied On December 20, 2019 01:33 AM UTC

1 additional finding. If the view show a BarSeries / ColumnSeries chart first then only show DoughnutSeries / PieSeries chart then it work without crash.

Hemalatha Marikumar [Syncfusion]
Replied On December 20, 2019 01:08 PM UTC

Hi Ooi Keng Siang, 
  
Greetings from Syncfusion. 
  
We have checked the reported issue and we can resolve this issue by initializing the SfChart instance first and then initialize the Doughnut series as per in below code snippet, 
  
CodeSnippet[C#]: 
//Initialize the SfChart instance first 
SfChart chart = new SfChart(this); 
DoughnutSeries series = new DoughnutSeries(); 
  
We would like to let you know that the reported issue is an already known issue and currently we are fixed the same. The fix will be included in our Weekly Nuget release which is expected to be rolled out on December 24,2019. 
 
Meanwhile, please use the above provided solution and let us know if you have any other concern. 
 
Regards, 
Hemalatha M.  
 


Ooi Keng Siang
Replied On December 20, 2019 02:07 PM UTC

Thanks for the workaround. It worked.

Hemalatha Marikumar [Syncfusion]
Replied On December 23, 2019 06:02 AM UTC

Hi Ooi Keng Siang, 
 
Thanks for your update. 
 
We are glad to hear given workaround works at your end.  
 
We would like to let you know that we included the fix of the reported crash issue in our tomorrow (December 24,2019) rolled out weekly Nuget release.  
 
Please check it out and let us know if you have any other concerns. 
 
Regards, 
Hemalatha M. 
 
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon