Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to display missing and other information in pie panel #198

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions panels/pie/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
<div class="span1">
<label class="small"> Labels </label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels">
</div>
<div class="span1">
<label class="small"> Others </label><input type="checkbox" ng-model="panel.others" ng-checked="panel.others">
</div>
<div class="span1">
<label class="small"> Missing </label><input type="checkbox" ng-model="panel.missing" ng-checked="panel.missing">
</div>
<div class="span3">
<label class="small">Legend</label>
<select class="input-small" ng-model="panel.legend" ng-options="f for f in ['above','below','none']"></select></span>
Expand Down
2 changes: 1 addition & 1 deletion panels/pie/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div pie params="{{panel}}" style="height:{{panel.height || row.height}};position:relative"></div>

<div ng-show="panel.legend == 'below'" ng-repeat="query in plot.getData()" style="float:left;padding-left: 10px;">
<div ng-show="panel.legend == 'below'" ng-repeat="query in plot.getData()" style="float:left;padding-left: 10px;" ng-click="build_search(panel.query.field,query.label)" >
<span ng-show='panel.chart != "none"'><div style="display:inline-block;border-radius:5px;background:{{query.color}};height:10px;width:10px"></div></span><span class="small"> {{query.label}} ({{query.data[0][1]}}) </span></span>
</div>
</kibana-panel>
6 changes: 6 additions & 0 deletions panels/pie/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ angular.module('kibana.pie', [])
tilt : false,
legend : true,
labels : true,
others : true,
missing : true,
mode : "terms",
group : "default",
default_field : 'DEFAULT',
Expand Down Expand Up @@ -125,6 +127,10 @@ angular.module('kibana.pie', [])
$scope.hits = results.hits.total;
$scope.data = [];
var k = 0;
if($scope.panel.others && results.facets.pie.other > 0)
results.facets.pie.terms.push({ 'term': 'Other', 'count': results.facets.pie.other });
if($scope.panel.missing && results.facets.pie.missing > 0)
results.facets.pie.terms.push({ 'term': 'Missing', 'count': results.facets.pie.missing });
_.each(results.facets.pie.terms, function(v) {
var slice = { label : v.term, data : v.count };
$scope.data.push();
Expand Down