diff --git a/src/chart/bar/BarView.js b/src/chart/bar/BarView.js index a749dbb61108dd3f04f81cd75563786943e434d0..1bb55a33e1d288336c220ad95011bfea7933cb38 100644 --- a/src/chart/bar/BarView.js +++ b/src/chart/bar/BarView.js @@ -28,7 +28,6 @@ define(function (require) { var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); - var isInverse = cartesian.getOtherAxis(baseAxis).inverse; var isHorizontal = baseAxis.isHorizontal(); var enableAnimation = ecModel.get('animation'); @@ -126,21 +125,26 @@ define(function (require) { this._data = data; }, - remove: function () { - if (this._data) { - var group = this.group; - this._data.eachItemGraphicEl(function (el) { - // Not show text when animating - el.style.text = ''; - el.animateTo({ - shape: { - width: 0 - } - }, 300, 'cubicOut', - function () { - group.remove(el); + remove: function (ecModel) { + var group = this.group; + if (ecModel.get('animation')) { + if (this._data) { + this._data.eachItemGraphicEl(function (el) { + // Not show text when animating + el.style.text = ''; + el.animateTo({ + shape: { + width: 0 + } + }, 300, 'cubicOut', + function () { + group.remove(el); + }); }); - }); + } + } + else { + group.removeAll(); } } }); diff --git a/src/chart/line/LineView.js b/src/chart/line/LineView.js index 52cbb6c4bfff317121d04d2ea2b18d41ffff7a98..310b7abaa9ec7318131bbee446c8e5d8977f0440 100644 --- a/src/chart/line/LineView.js +++ b/src/chart/line/LineView.js @@ -397,11 +397,11 @@ define(function(require) { return clipPath; }, - remove: function () { + remove: function (ecModel) { var group = this.group; group.remove(this._polyline); group.remove(this._polygon); - this._dataSymbol.remove(true); + this._dataSymbol.remove(ecModel.get('animation')); } }); }); \ No newline at end of file diff --git a/src/chart/scatter/ScatterView.js b/src/chart/scatter/ScatterView.js index bf398ca40c56430f6a05fc4c3998f096385b6e45..7642cd6eb8fb11dc484a801e876ede9992bb4972 100644 --- a/src/chart/scatter/ScatterView.js +++ b/src/chart/scatter/ScatterView.js @@ -17,8 +17,8 @@ define(function (require) { ); }, - remove: function () { - this._dataSymbol.remove(true); + remove: function (ecModel) { + this._dataSymbol.remove(ecModel.get('animation')); } }); }); \ No newline at end of file diff --git a/src/echarts.js b/src/echarts.js index 06cb1ebafc41873e8aa1b3126e7a531be920b0ca..1e445025050d05eadd6758783d76808b1e8132b5 100644 --- a/src/echarts.js +++ b/src/echarts.js @@ -423,7 +423,7 @@ define(function (require) { // Remove groups of charts zrUtil.each(this._chartsList, function (chart) { if (!chart.__keepAlive) { - chart.remove(); + chart.remove(ecModel, api); } }, this); }, diff --git a/src/view/Chart.js b/src/view/Chart.js index bdd0d6c0d2154294da29168885f35c1c8e8db759..30758af52916447e21cb90bb055b61285b76a30b 100644 --- a/src/view/Chart.js +++ b/src/view/Chart.js @@ -26,7 +26,7 @@ define(function (require) { render: function (seriesModel, ecModel, api) {}, - remove: function () { + remove: function (ecModel, api) { this.group.removeAll(); },