added charts to micropanel in table

This commit is contained in:
Rashid Khan
2013-08-20 07:24:04 -07:00
parent 2e74275b42
commit eba4214b97
8 changed files with 185 additions and 167 deletions
+7
View File
@@ -70,6 +70,8 @@ angular.module('kibana.table', [])
$scope.get_data();
};
$scope.percent = kbn.to_percent;
$scope.toggle_micropanel = function(field) {
var docs = _.pluck($scope.data,'_source');
$scope.micropanel = {
@@ -80,6 +82,11 @@ angular.module('kibana.table', [])
};
};
$scope.micropanelColor = function(index) {
var _c = ['bar-success','bar-warning','bar-danger','bar-info','bar-primary'];
return index > _c.length ? '' : _c[index];
};
$scope.set_sort = function(field) {
if($scope.panel.sort[0] === field) {
$scope.panel.sort[1] = $scope.panel.sort[1] === 'asc' ? 'desc' : 'asc';