Commit 7eac56bc by Rashid Khan

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

parent cf29ef2d
......@@ -47,6 +47,19 @@
<div class="row-fluid">
<div class="span12">
<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>
\ No newline at end of file
......@@ -96,10 +96,10 @@ function (angular, app, _, kbn, moment) {
// Create a percent function for the view
$scope.percent = kbn.to_percent;
$scope.termsModal = function(field) {
$scope.termsModal = function(field,chart) {
$scope.modalField = field;
showModal(
'{"height":"200px","chart":"bar","field":"'+field+'"}','terms');
'{"height":"300px","chart":"'+chart+'","field":"'+field+'"}','terms');
};
$scope.statsModal = function(field) {
......
......@@ -75,7 +75,7 @@ function (angular, _, config) {
ret = {};
for(var attr in obj){
// 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') {
ret[attr] = obj[attr]['fields'][attr] || obj[attr];
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