Browse Source

snapshot: fix legend rendering bug

Alexander Zobnin 7 years ago
parent
commit
a472d38fbf
1 changed files with 5 additions and 2 deletions
  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