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

SfChart GetStream() Implementation for UWP

Thread ID:

Created:

Updated:

Platform:

Replies:

141953 Jan 11,2019 07:19 PM UTC Jan 14,2019 05:54 AM UTC Xamarin.Forms 1
loading
Tags: SfChart
Mark Tannehill
Asked On January 11, 2019 07:19 PM UTC

I have a need to save a thumbnail of my Sfchart images to display as a summary tab elsewhere. How can I generate an image or a stream from the current Sfchart? I don't want to save to device first. Much like if I were going to copy image to clipboard.

.GetStream() only works for iOs and Android.

Michael Prabhu M [Syncfusion]
Replied On January 14, 2019 05:54 AM UTC



Hi Mark, 

Greetings from Syncfusion, 

We have validated your requirement and we would like to let you know that in UWP there is not GetStream method instead we can use the ImageStream to get the convert the chart as image. Also, there is a framework level limitation in UWP in getting the stream on the fly. So, you need to add the chart in the view in order to convert that as an image stream. To learn more on this limitation, please refer the below link. 


So, to get the chart as image in UWP you can use SaveAsImage method as like in below code snippet. 

Code Snippet C# 
private void Button_Clicked(object sender, EventArgs e) 
       
            chart.SaveAsImage("chart.jpg"); 
       


We have prepared a sample to convert the chart into image and the sample can be downloaded from the below link. 

Sample: ChartToImage 

Let us know if you need any other assistance from us. 

Thanks, 
Michael  


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