diff --git a/lib/shared/addon/components/graph-area/component.js b/lib/shared/addon/components/graph-area/component.js index 5fed4378d..4ff2a3593 100644 --- a/lib/shared/addon/components/graph-area/component.js +++ b/lib/shared/addon/components/graph-area/component.js @@ -105,6 +105,7 @@ export default Component.extend(ThrottledResize, { const chart = get(this, 'chart'); if ( chart ) { + chart.clear(); chart.dispose(); } }, @@ -153,10 +154,10 @@ export default Component.extend(ThrottledResize, { set(this, 'chart', chart); chart.showLoading(LOADING_PARAMS); - this.draw(); + this.draw(false); }, - draw() { + draw(update = true) { const chart = get(this, 'chart'); if ( !chart ) { @@ -247,7 +248,16 @@ export default Component.extend(ThrottledResize, { option.yAxis.max = minMax; } - chart.setOption(option, true); + let newOptions; + + if ( update ) { + newOptions = { series }; + } else { + newOptions = option; + } + + chart.clear(); + chart.setOption(newOptions, true); chart.hideLoading(); },