提交 2ff9c82e 编写于 作者: P pah100

fix `graphic` component restore data (and cause downplay not work) unexpectly when setOtion.

上级 6f2f9a1f
......@@ -283,7 +283,7 @@ define(function (require) {
mainType !== 'graphic' && (this.__lastOnlyGraphic = false);
}, this);
this._model.setOption(option, optionPreprocessorFuncs);
this._model.setOption(option, optionPreprocessorFuncs, this.__lastOnlyGraphic);
if (lazyUpdate) {
this[OPTION_UPDATED] = {silent: silent};
......
......@@ -63,7 +63,7 @@ define(function (require) {
this._optionManager = optionManager;
},
setOption: function (option, optionPreprocessorFuncs) {
setOption: function (option, optionPreprocessorFuncs, onlyGraphic) {
zrUtil.assert(
!(OPTION_INNER_KEY in option),
'please use chart.getOption()'
......@@ -71,7 +71,7 @@ define(function (require) {
this._optionManager.setOption(option, optionPreprocessorFuncs);
this.resetOption();
this.resetOption(null, onlyGraphic);
},
/**
......@@ -81,7 +81,7 @@ define(function (require) {
* 'media': only reset media query option
* @return {boolean} Whether option changed.
*/
resetOption: function (type) {
resetOption: function (type, onlyGraphic) {
var optionChanged = false;
var optionManager = this._optionManager;
......@@ -92,7 +92,11 @@ define(function (require) {
initBase.call(this, baseOption);
}
else {
this.restoreData();
// If only graphic, other series and component will not
// go through update process, data should not be restored.
// Otherwise grphic els mounted on data will be eliminated
// and downplay will not work.
!onlyGraphic && this.restoreData();
this.mergeOption(baseOption);
}
optionChanged = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册