Commit 4384772d by Rashid Khan

Fix undefined when batarang is enabled. Fix individual query counters in histogram panel

parent 4ce88ee7
...@@ -60,6 +60,7 @@ function (angular, _) { ...@@ -60,6 +60,7 @@ function (angular, _) {
loadController(name); loadController(name);
}); });
if(attr.panel) {
$scope.$watch(attr.panel, function (panel) { $scope.$watch(attr.panel, function (panel) {
// If the panel attribute is specified, create a new scope. This ruins configuration // 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 // so don't do it with anything that needs to use editor.html
...@@ -69,6 +70,7 @@ function (angular, _) { ...@@ -69,6 +70,7 @@ function (angular, _) {
} }
}); });
} }
}
}; };
}); });
......
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
<a class='small' ng-click='zoom(2)'><i class='icon-zoom-out'></i> Zoom Out</a> |&nbsp <a class='small' ng-click='zoom(2)'><i class='icon-zoom-out'></i> Zoom Out</a> |&nbsp
</span> </span>
<span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend"> <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 class='small histogram-legend-item'>
<span ng-if="panel.show_query">{{series.alias || series.query}}</span> <span ng-if="panel.show_query">{{series.query.alias || series.query.query}}</span>
<span ng-if="!panel.show_query">{{series.alias}}</span> <span ng-if="!panel.show_query">{{series.query.alias}}</span>
<span ng-show="panel.legend_counts"> ({{series.hits}})</span> <span ng-show="panel.legend_counts"> ({{series.hits}})</span>
</span> </span>
</span> </span>
......
...@@ -425,7 +425,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -425,7 +425,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope.hits += entry.count; // Entire dataset level hits counter $scope.hits += entry.count; // Entire dataset level hits counter
}); });
$scope.legend[i] = q; $scope.legend[i] = {query:q,hits:hits};
data[i] = { data[i] = {
info: q, info: q,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment