Skip to content

Commit

Permalink
fix(svg): download svg image with toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Feb 14, 2020
1 parent 86d1df7 commit fa5952a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/component/toolbox/feature/SaveAsImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fa5952a

Please sign in to comment.