Allow the chart to save to local documents folders of the App

I am trying to use the Maui SfChart control in Native ios and native android with native embedding. This control have a method SaveAsImage to save it to pictures folder. But it would be nice if you could allow it to save it Local documents folder of the application or allow receiving directory also a parameter in addition to filename.



4 Replies

SS Sowndharya Selladurai Syncfusion Team December 6, 2023 01:44 PM UTC

Hi Balasubramanian,

Our development team is actively working on your query, and we will provide an update on December 8th, 2023. Thanks for your patience and understanding.


Regards,

Sowndharya.



BR Balasubramanian Ramanathan December 7, 2023 04:33 PM UTC

Thank. Will wait for the reply from development team.



SA Saiyath Ali Fathima Bee Moidhin Abdhul Kathar Syncfusion Team December 8, 2023 01:40 PM UTC

Hello Balasubramanian,

 

Our development team is currently analyzing the query you mentioned at the source level. We will provide our response on December 12, 2023. Thank you for your patience.

 

Regards,

Saiyath Ali Fathima M



SA Saiyath Ali Fathima Bee Moidhin Abdhul Kathar Syncfusion Team December 12, 2023 12:06 PM UTC

Hello Balasubramanian,


We would like to inform you that we can able to export the image to the desired location as follows:


 private async void Button_ClickedAsync(object? sender, System.EventArgs e)

 {

     string targetFilePath = ("/storage/emulated/0/Documents/" + "sampleImage.png");

     using (Stream stream = await chart.GetStreamAsync(ImageFileFormat.Png))

     using (MemoryStream ms = new MemoryStream())

     {

         await stream.CopyToAsync(ms);

         await File.WriteAllBytesAsync(targetFilePath, ms.ToArray());

     }

 }


For further reference, we have attached a runnable sample below.


Regards,

Saiyath Ali Fathima M


Attachment: NativeAndroidApp_1_dd19138f.zip

Loader.
Up arrow icon