Merge pull request #2763 from loganhz/oom

Fix graph issue
This commit is contained in:
Westly Wright 2019-03-14 09:14:11 -07:00 committed by GitHub
commit 6c091aa230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -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();
},