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 <zwl.s...@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-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to