mirror of https://github.com/rancher/ui.git
commit
6c091aa230
|
|
@ -105,6 +105,7 @@ export default Component.extend(ThrottledResize, {
|
||||||
const chart = get(this, 'chart');
|
const chart = get(this, 'chart');
|
||||||
|
|
||||||
if ( chart ) {
|
if ( chart ) {
|
||||||
|
chart.clear();
|
||||||
chart.dispose();
|
chart.dispose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -153,10 +154,10 @@ export default Component.extend(ThrottledResize, {
|
||||||
|
|
||||||
set(this, 'chart', chart);
|
set(this, 'chart', chart);
|
||||||
chart.showLoading(LOADING_PARAMS);
|
chart.showLoading(LOADING_PARAMS);
|
||||||
this.draw();
|
this.draw(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
draw() {
|
draw(update = true) {
|
||||||
const chart = get(this, 'chart');
|
const chart = get(this, 'chart');
|
||||||
|
|
||||||
if ( !chart ) {
|
if ( !chart ) {
|
||||||
|
|
@ -247,7 +248,16 @@ export default Component.extend(ThrottledResize, {
|
||||||
option.yAxis.max = minMax;
|
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();
|
chart.hideLoading();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue