You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2020/02/13 02:45:07 UTC

[incubator-echarts] 01/02: fix(svg): download svg image with toolbox

This is an automated email from the ASF dual-hosted git repository.

ovilia pushed a commit to branch fix-11781
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 154b36f70933ef2ff82e52288756698658fc9369
Author: Ovilia <zw...@gmail.com>
AuthorDate: Wed Feb 12 15:52:31 2020 +0800

    fix(svg): download svg image with toolbox
---
 src/component/toolbox/feature/SaveAsImage.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/component/toolbox/feature/SaveAsImage.js b/src/component/toolbox/feature/SaveAsImage.js
index d81a06d..cde8a0a 100644
--- a/src/component/toolbox/feature/SaveAsImage.js
+++ b/src/component/toolbox/feature/SaveAsImage.js
@@ -50,7 +50,8 @@ var proto = SaveAsImage.prototype;
 proto.onclick = function (ecModel, api) {
     var model = this.model;
     var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';
-    var type = model.get('type', true) || 'png';
+    var isSvg = api.getZr().painter.getType() === 'svg';
+    var type = isSvg ? 'svg' : model.get('type', true) || 'png';
     var url = api.getConnectedDataURL({
         type: type,
         backgroundColor: model.get('backgroundColor', true)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org