浏览代码

snapshot: fix legend rendering bug

Alexander Zobnin 7 年之前
父节点
当前提交
a472d38fbf
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      public/app/features/panel/metrics_panel_ctrl.ts

+ 5 - 2
public/app/features/panel/metrics_panel_ctrl.ts

@@ -78,8 +78,11 @@ class MetricsPanelCtrl extends PanelCtrl {
         data = data.data;
       }
 
-      this.events.emit('data-snapshot-load', data);
-      return;
+      // Defer panel rendering till the next digest cycle.
+      // For some reason snapshot panels don't init at this time, so this helps to avoid rendering issues.
+      return this.$timeout(() => {
+        this.events.emit('data-snapshot-load', data);
+      });
     }
 
     // // ignore if we have data stream