move percentage indication into parent class

This commit is contained in:
Joe Fleming 2015-08-21 17:05:12 -05:00
parent 1cfc8813df
commit 2be81abbfe
2 changed files with 3 additions and 3 deletions

View file

@ -260,7 +260,8 @@ define(function (require) {
AggConfig.prototype.makeLabel = function () {
if (!this.type) return '';
return this.type.makeLabel(this);
var pre = (_.get(this.vis, 'params.mode') === 'percentage') ? 'Percentage of ' : '';
return pre += this.type.makeLabel(this);
};
AggConfig.prototype.field = function () {

View file

@ -7,8 +7,7 @@ define(function (require) {
name: 'count',
title: 'Count',
hasNoDsl: true,
makeLabel: function (agg) {
if (agg.vis.params.mode === 'percentage') return 'Percentage of Count';
makeLabel: function () {
return 'Count';
},
getFormat: function () {