How to convert a chart to image png in server side to export as FileStream

Hello,


I need to generate a pie chart on the server side and transform it into a png image without rendering an HTML page. Can you help? It's possible?


5 Replies

SB Swetha Babu Syncfusion Team June 10, 2024 07:22 AM UTC

Hi Roberto,


Greetings from Syncfusion.


In chart, we don’t have option to render and export chart in server. You can render and export the chart on server side by creating a Excel chart using the XlsIO library and export that chart in the server side. Please find the below documentation link for your reference.


Creation of chart - Working with charts | Syncfusion XlsIO 

Conversion of Chart to image -  Chart to Image conversion | Syncfusion XlsIO


Kindly, revert us if you have any concerns.


Regards,

Swetha



RO Roberto replied to Swetha Babu June 10, 2024 11:40 PM UTC

Okay, thanks for the answer.

And using html rendering via server side? I cannot load any browser emulators as the hosting service considers it a suspicious operation.


Thanks



MM Mugil Murugan Syncfusion Team June 18, 2024 01:37 PM UTC

Hi Roberto,

We can render and export the chart on a client side by default. The export method in chart will export the chart element in the UI. So, we do not have support to render and export the chart from server side.  
 

Please find the attached file for the client-side chart rendering. The documentation link for Export is mentioned below.

Please refer to the
UG for more about Export.

Regards,
Mugil M.

 


Attachment: ChartExport_313ed74b.zip


RO Roberto June 19, 2024 10:27 PM UTC

Hello,

I understand, but that doesn't help because I will send the chart to a bot on Telegram when the user requests it.

I'll look for other options.

Thank you for the explanation.



MM Mugil Murugan Syncfusion Team June 20, 2024 09:12 AM UTC

Hi Roberto,


For the server side, as mentioned in the previous update, you can create a chart and export it to an image.


Regards,

Mugil M.


Loader.
Up arrow icon