我想将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] 删除。
我来说两句