fix: row模式每次重建HiChart

This commit is contained in:
qinglong
2026-06-14 15:01:22 +08:00
parent 627ce01018
commit 5c41bf7a59
+1 -9
View File
@@ -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') {