Added pie and histogram editors

This commit is contained in:
Rashid Khan
2013-02-08 15:18:35 -07:00
parent 19798b0891
commit b94ea26b9c
5 changed files with 151 additions and 38 deletions
+14 -3
View File
@@ -5,9 +5,8 @@ angular.module('kibana.histogram', [])
// Set and populate defaults
var _d = {
query : "*",
query : { query: "*" },
interval: secondsToHms(calculate_interval($scope.from,$scope.to,40,0)/1000),
color : "#27508C",
show : ['bars'],
fill : false,
group : "default",
@@ -24,6 +23,18 @@ angular.module('kibana.histogram', [])
eventBus.broadcast($scope.$id,$scope.panel.group,'get_time')
}
$scope.remove_query = function(q) {
$scope.panel.query = _.without($scope.panel.query,q);
}
$scope.add_query = function(label,query) {
$scope.panel.query.unshift({
query: query,
label: label,
});
$scope.get_data();
}
$scope.get_data = function() {
// Make sure we have everything for the request to complete
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.panel.time))
@@ -68,7 +79,7 @@ angular.module('kibana.histogram', [])
data.push([$scope.panel.time.to.getTime(), null])
var series = { data: {
label: $scope.panel.query[k].label,
label: $scope.panel.query[k].label || k,
data: data,
}};