Commit 7eac56bc by Rashid Khan

Added pie and table options to adhoc terms facet from table micro-panel

parent cf29ef2d
...@@ -47,6 +47,19 @@ ...@@ -47,6 +47,19 @@
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<h5>Facets</h5> <h5>Facets</h5>
<button class="btn" ng-click="termsModal(field);dismiss();"><i class="icon-list-ol"></i> Terms</button> <!--<button class="btn" ng-click="termsModal(field,'pie');dismiss();"><i class="icon-list-ol"></i> Terms</button>-->
<div class="btn-group">
<a class="btn dropdown-toggle pointer" data-toggle="dropdown">
<i class="icon-list-ol"></i> Terms
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a ng-click="termsModal(field,'bar');dismiss();">Bar</a></li>
<li><a ng-click="termsModal(field,'pie');dismiss();">Pie</a></li>
<li><a ng-click="termsModal(field,'table');dismiss();">Table</a></li>
</ul>
</div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -96,10 +96,10 @@ function (angular, app, _, kbn, moment) { ...@@ -96,10 +96,10 @@ function (angular, app, _, kbn, moment) {
// Create a percent function for the view // Create a percent function for the view
$scope.percent = kbn.to_percent; $scope.percent = kbn.to_percent;
$scope.termsModal = function(field) { $scope.termsModal = function(field,chart) {
$scope.modalField = field; $scope.modalField = field;
showModal( showModal(
'{"height":"200px","chart":"bar","field":"'+field+'"}','terms'); '{"height":"300px","chart":"'+chart+'","field":"'+field+'"}','terms');
}; };
$scope.statsModal = function(field) { $scope.statsModal = function(field) {
......
...@@ -75,7 +75,7 @@ function (angular, _, config) { ...@@ -75,7 +75,7 @@ function (angular, _, config) {
ret = {}; ret = {};
for(var attr in obj){ for(var attr in obj){
// For now only support multi field on the top level // For now only support multi field on the top level
// and if if there is a default field set. // and if there is a default field set.
if(obj[attr]['type'] === 'multi_field') { if(obj[attr]['type'] === 'multi_field') {
ret[attr] = obj[attr]['fields'][attr] || obj[attr]; ret[attr] = obj[attr]['fields'][attr] || obj[attr];
continue; continue;
......
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