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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Java.lang.Illegalstateexception while exporting invisible sfchart

Thread ID:

Created:

Updated:

Platform:

Replies:

142869 Feb 23,2019 11:14 AM UTC Feb 25,2019 11:47 AM UTC Xamarin.Forms 3
loading
Tags: SfChart
Ilya
Asked On February 23, 2019 11:14 AM UTC

Hello, 
i have a screen in xamarin.forms which displays either chart data, or chart itself (toggles with switch )
i have a share button which calls the code to share chart
it's ok when chart is visible, but i'm getting an exception on chart.GetStream () in android part

Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

i attaching stack trace

is it a bug or a feature and i can't export invisible chart ?

sincerely
Ilya


Attachment: stack_fa33c21f.zip

Bharathiraja K [Syncfusion]
Replied On February 25, 2019 10:52 AM UTC

Hi Ilya, 
 
Greetings from Syncfusion. 
 
We were able to reproduce the reported issue at our end when setting chart IsVisible property to false. May I know the purpose of disabling the chart while converting the chart as stream? If you provide the use case scenario of your requirement, it will be helpful for us to provide you a better solution.  
 
Regards, 
Bharathi. 


Ilya
Replied On February 25, 2019 11:39 AM UTC

i have a page which displays either text information or its chart representation with radio button switching the view
also, there is a share button to share information. on tap of this button the chart will be shared .

currently i sort it out bit rude ;) switching chart visible, sharing it and switching back

 bool bShowChart = ShowChart.IsToggled;
   if (!bShowChart)
            {
                ShowChart.IsToggled = true;
                Device.StartTimer(new TimeSpan(0, 0, 0, 0, 10), () =>
                {
                    if (!chartData.IsVisible) return (true);
                    try
                    {
                        DependencyService.Get<iUtility>().ShareChartAsImage(chartData);
                    }
                    catch (Exception ex)
                    {

                    }
                    if (!bShowChart) ShowChart.IsToggled = false;
                    return (false);
                });
                return;
            }



Bharathiraja K [Syncfusion]
Replied On February 25, 2019 11:47 AM UTC

Hi Ilya, 
 
Greetings from Syncfusion. 
 
We were able to reproduce the reported issue at our end when setting chart IsVisible property to false. May I know the purpose of disabling the chart while converting the chart as stream? If you provide the use case scenario of your requirement, it will be helpful for us to provide you a better solution.  
 
Regards, 
Bharathi. 


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

;