From 802d34cef64af253e468a6a9cdae3375478f5565 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Thu, 4 Apr 2013 08:08:41 -0700 Subject: [PATCH] Fixed issue where legend may not show on initial load --- panels/histogram/module.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/panels/histogram/module.js b/panels/histogram/module.js index e04e6716ad8..bba3ce9bc74 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -112,7 +112,7 @@ angular.module('kibana.histogram', []) var series = { data: { - label: $scope.panel.query[k].label || k, + label: $scope.panel.query[k].label || (parseInt(k)+1), data: data, }, @@ -167,11 +167,7 @@ angular.module('kibana.histogram', []) var height = scope.panel.height || scope.row.height; - elem.html( - '
'+ - '
'+ - '
'+ - '
') + elem.html('
') // Receive render events scope.$on('render',function(){ @@ -211,7 +207,7 @@ angular.module('kibana.histogram', []) scripts.wait(function(){ // Populate element try { - var plot = $.plot($('.chart',elem), scope.data, { + var plot = $.plot(elem, scope.data, { legend: { show: false, }, @@ -248,6 +244,7 @@ angular.module('kibana.histogram', []) _.each(plot.getData(),function(series) { scope.legend.push(_.pick(series,'label','color')) }) + scope.$apply() } catch(e) { elem.text(e) }