You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Nouman <no...@yahoo.com.INVALID> on 2019/10/22 17:17:26 UTC

Question on how to save an Image pragmatically - Need help please

Hello Echarts dev,
I have been a fan of echarts for over 2 years. I have a use case and i am struggling to get it implemented and any help from you would be tremendously appreciated.
I have a use case to save the image pragmatically and not via toolbox interactive feature. Can you help me with any code sample or the way to achieve it. I want the image to be saved in C:\Images folder on my windows system with a predefined name. 
Thanks,Nouman

Re: Question on how to save an Image pragmatically - Need help please

Posted by Ovilia <ov...@gmail.com>.
Hi Nouman,

Thanks for choosing ECharts.

You can use this API to get the image in base64 form:
https://echarts.apache.org/en/api.html#echartsInstance.getDataURL
And here's how to save base64 to file:
https://gist.github.com/madhums/e749dca107e26d72b64d

Hope that helps. :)

Wenli


On Wed, Oct 23, 2019 at 1:21 AM Nouman <no...@yahoo.com.invalid> wrote:

> Hello Echarts dev,
> I have been a fan of echarts for over 2 years. I have a use case and i am
> struggling to get it implemented and any help from you would be
> tremendously appreciated.
> I have a use case to save the image pragmatically and not via toolbox
> interactive feature. Can you help me with any code sample or the way to
> achieve it. I want the image to be saved in C:\Images folder on my windows
> system with a predefined name.
> Thanks,Nouman