是否可以在Echarts中将图表另存为图像而无需工具箱交互?

g

我想将echart保存为图片。如果该toolbox.saveAsImage选项设置为true,我可以使用工具箱操作来保存图表。但是,我想知道是否可以通过编程方式完成?

奥维利亚

这应该通过来实现echartsInstance.getDataURL,您可以使用来设置图像格式,像素比率等。

(opts: {
    // Exporting format, can be either png, or jpeg
    type?: string,
    // Resolution ratio of exporting image, 1 by default.
    pixelRatio?: number,
    // Background color of exporting image, use backgroundColor in option by default.
    backgroundColor?: string,
    // Excluded components list. e.g. ['toolbox']
    excludeComponents?: Array.<string>
}) => string

有关更多信息,请参见ECharts文档

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章