From 4ce88ee7b775f6926f1f9dc2f9a3fea2d688b763 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 9 Dec 2013 16:23:23 -0700 Subject: [PATCH] Fix legend --- src/app/panels/histogram/module.html | 8 ++++---- src/app/panels/histogram/module.js | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/panels/histogram/module.html b/src/app/panels/histogram/module.html index 20ca4732d93..f52b408e4cb 100644 --- a/src/app/panels/histogram/module.html +++ b/src/app/panels/histogram/module.html @@ -43,11 +43,11 @@ Zoom Out |  - - + + - {{series.info.alias || series.info.query}} - {{series.info.alias}} + {{series.alias || series.query}} + {{series.alias}} ({{series.hits}}) diff --git a/src/app/panels/histogram/module.js b/src/app/panels/histogram/module.js index 74fa7c906c3..d2a3551d2bd 100644 --- a/src/app/panels/histogram/module.js +++ b/src/app/panels/histogram/module.js @@ -380,6 +380,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) { return results.then(function(results) { $scope.panelMeta.loading = false; if(segment === 0) { + $scope.legend = []; $scope.hits = 0; data = []; $scope.annotations = []; @@ -423,6 +424,9 @@ function (angular, app, $, _, kbn, moment, timeSeries) { hits += entry.count; // The series level hits counter $scope.hits += entry.count; // Entire dataset level hits counter }); + + $scope.legend[i] = q; + data[i] = { info: q, time_series: time_series, @@ -530,7 +534,8 @@ function (angular, app, $, _, kbn, moment, timeSeries) { }); // Receive render events - scope.$on('render',function(event,data){ + scope.$on('render',function(event,d){ + data = d || data; render_panel(data); });