Export charts in background

Hi there,

Is it possible to save a chart as image in the background? I Need to create several charts in the background without the user seeing them and save them later as images.
No images get created when i try:
var chart = new SfChart();
// .....
chart.SaveAsImage("PowderChart_Days.jpg");
Will the charts only be drawn, when I add them to a View?
Thanks for an answer.
Greetings
Fabian

3 Replies

DV Divya Venkatesan Syncfusion Team January 11, 2018 05:04 PM UTC

Hi Fabian,

You can save the Chart without adding it to UI tree by getting the stream of the Chart. Please download the sample from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/135399/ze/ChartSaveAsImage-1665183867

Please let us know, if you need any further assistance.

Regards,
Divya Venkatesan



FE Fabian Eriksson January 15, 2018 11:03 AM UTC

Thanks, that worked perfectly!


PR Padmini Ramamurthy Syncfusion Team January 16, 2018 07:20 AM UTC

Hi Fabian, 
  
Thanks for your response, we are glad that the provided solution resolved the issue and please get back to us if you need any other assistance. 
  
Regards, 
Padmini R. 


Loader.
Up arrow icon