Skip to content

Commit

Permalink
Fix undefined when batarang is enabled. Fix individual query counters…
Browse files Browse the repository at this point in the history
… in histogram panel
  • Loading branch information
Rashid Khan committed Dec 11, 2013
1 parent 4ce88ee commit 4384772
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions src/app/directives/kibanaSimplePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
}
};
});
Expand Down
6 changes: 3 additions & 3 deletions src/app/panels/histogram/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
<a class='small' ng-click='zoom(2)'><i class='icon-zoom-out'></i> Zoom Out</a> |&nbsp
</span>
<span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend">
<i class='icon-circle' ng-style="{color: series.color}"></i>
<i class='icon-circle' ng-style="{color: series.query.color}"></i>
<span class='small histogram-legend-item'>
<span ng-if="panel.show_query">{{series.alias || series.query}}</span>
<span ng-if="!panel.show_query">{{series.alias}}</span>
<span ng-if="panel.show_query">{{series.query.alias || series.query.query}}</span>
<span ng-if="!panel.show_query">{{series.query.alias}}</span>
<span ng-show="panel.legend_counts"> ({{series.hits}})</span>
</span>
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/app/panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4384772

Please sign in to comment.