diff --git a/src/app/directives/kibanaSimplePanel.js b/src/app/directives/kibanaSimplePanel.js index 6274e8749f9..bb6b44c747c 100644 --- a/src/app/directives/kibanaSimplePanel.js +++ b/src/app/directives/kibanaSimplePanel.js @@ -60,14 +60,16 @@ function (angular, _) { loadController(name); }); - $scope.$watch(attr.panel, function (panel) { - // If the panel attribute is specified, create a new scope. This ruins configuration - // so don't do it with anything that needs to use editor.html - if(!_.isUndefined(panel)) { - $scope = $scope.$new(); - $scope.panel = angular.fromJson(panel); - } - }); + if(attr.panel) { + $scope.$watch(attr.panel, function (panel) { + // If the panel attribute is specified, create a new scope. This ruins configuration + // so don't do it with anything that needs to use editor.html + if(!_.isUndefined(panel)) { + $scope = $scope.$new(); + $scope.panel = angular.fromJson(panel); + } + }); + } } }; }); diff --git a/src/app/panels/histogram/module.html b/src/app/panels/histogram/module.html index f52b408e4cb..3db0048586f 100644 --- a/src/app/panels/histogram/module.html +++ b/src/app/panels/histogram/module.html @@ -44,10 +44,10 @@ Zoom Out |  - + - {{series.alias || series.query}} - {{series.alias}} + {{series.query.alias || series.query.query}} + {{series.query.alias}} ({{series.hits}}) diff --git a/src/app/panels/histogram/module.js b/src/app/panels/histogram/module.js index 641f85fb68c..734550e1064 100644 --- a/src/app/panels/histogram/module.js +++ b/src/app/panels/histogram/module.js @@ -425,7 +425,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) { $scope.hits += entry.count; // Entire dataset level hits counter }); - $scope.legend[i] = q; + $scope.legend[i] = {query:q,hits:hits}; data[i] = { info: q, diff --git a/src/app/panels/histogram/timeSeries.js b/src/app/panels/histogram/timeSeries.js index 8885e734371..4b0472c1e73 100644 --- a/src/app/panels/histogram/timeSeries.js +++ b/src/app/panels/histogram/timeSeries.js @@ -101,6 +101,8 @@ function (_, Interval) { strategy = this._getAllFlotPairs; } else if(this.opts.fill_style === 'null') { strategy = this._getNullFlotPairs; + } else if(this.opts.fill_style === 'no') { + strategy = this._getNoZeroFlotPairs; } else { strategy = this._getMinFlotPairs; } @@ -211,6 +213,20 @@ function (_, Interval) { return result; }; + /** + * ** called as a reduce stragegy in getFlotPairs() ** + * Not fill zero's on either side of the current time, only the current time + * @return {array} An array of points to plot with flot + */ + ts.ZeroFilled.prototype._getNoZeroFlotPairs = function (result, time) { + + // add the current time + if(this._data[time]){ + result.push([ time, this._data[time]]); + } + + return result; + }; return ts; }); \ No newline at end of file