AntonioLoureiro / ECharts.jl

Other
2 stars 0 forks source link

Save EChart to disk (PNG or SVG export) #1

Open agcmoser opened 5 years ago

agcmoser commented 5 years ago

Dear Antonio,

ist is possible to export an EChart as PNG over even better as a vector graphic (SVG)? I am creating Sankey-Diagrams like in your example (https://randyzwitch.com/ECharts.jl/sankey) and would like to save the resulting image automatically.

In the EChart documentation I found this: https://ecomfe.github.io/echarts-doc/public/en/api.html#echartsInstance.getDataURL

but I don't know how to acess the getDataURL function via the Julia wrapper.

Any help or feature addition would be highly appreciated.

All the best, and keep up the good work Andreas

jzazo commented 4 years ago

Did you figure out how to save a png image from an EChart @agcmoser ? Do you know how to do that, @AntonioLoureiro ? Thanks.

AntonioLoureiro commented 4 years ago

Dear Antonio,

ist is possible to export an EChart as PNG over even better as a vector graphic (SVG)? I am creating Sankey-Diagrams like in your example (https://randyzwitch.com/ECharts.jl/sankey) and would like to save the resulting image automatically.

In the EChart documentation I found this: https://ecomfe.github.io/echarts-doc/public/en/api.html#echartsInstance.getDataURL

but I don't know how to acess the getDataURL function via the Julia wrapper.

Any help or feature addition would be highly appreciated.

All the best, and keep up the good work Andreas

Sorry, for the late reply, i think your question is related to a different package https://randyzwitch.com/ECharts.jl

AntonioLoureiro commented 4 years ago

Did you figure out how to save a png image from an EChart @agcmoser ? Do you know how to do that, @AntonioLoureiro ? Thanks.

There is no direct option in the package to save files to disk. The echarts api has a method echartsInstance.getDataURL to do it, but this package does not wrap that method, i could do it, but actually you would always need a browser to save the chart!

The only only way that i know to save a chart (server-side) without a browser is using something like PhantomJS (headless browser).

Do not know if that helps in your use case.