I'd like to save an echart as an image. If the toolbox.saveAsImage option is set to true, I can use a toolbox action to save the chart. However, I'm wondering if this can be done programmatically?
I'd like to save an echart as an image. If the toolbox.saveAsImage option is set to true, I can use a toolbox action to save the chart. However, I'm wondering if this can be done programmatically?
If you have echart instance variable, use getDataURL method with params like this:
echartInstance.getDataURL({
pixelRatio: 2,
backgroundColor: '#fff'
});
Calling e.getDataURL() without options won't work.