fix: row模式每次重建HiChart
This commit is contained in:
@@ -322,15 +322,7 @@
|
|||||||
grid.appendChild(card);
|
grid.appendChild(card);
|
||||||
_cardCache[id] = card;
|
_cardCache[id] = card;
|
||||||
if (isRow) {
|
if (isRow) {
|
||||||
// 销毁旧图表实例
|
if (_chartInstances[id]) { _chartInstances[id] = null; }
|
||||||
if (_chartInstances[id]) {
|
|
||||||
['cpu','mem','net'].forEach(function(k){
|
|
||||||
if (_chartInstances[id][k] && _chartInstances[id][k].canvas) {
|
|
||||||
var c = _chartInstances[id][k].canvas;
|
|
||||||
c.getContext('2d').clearRect(0,0,c.width,c.height);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
_chartInstances[id] = { cpu: null, mem: null, net: null };
|
_chartInstances[id] = { cpu: null, mem: null, net: null };
|
||||||
if (typeof MiniChart !== 'undefined') {
|
if (typeof MiniChart !== 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user