From a472d38fbf97dc721137ac7347c759e8e3f8db88 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 20 Mar 2018 21:33:54 +0300 Subject: [PATCH] snapshot: fix legend rendering bug --- public/app/features/panel/metrics_panel_ctrl.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index 373211611d8..6e7f326dc08 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/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