Skip to content

Commit

Permalink
Merge pull request #8648 from elastic/jasper/backport/8646/5.0
Browse files Browse the repository at this point in the history
[backport] PR #8646 to 5.0 - Fix label on scripted field date histograms
  • Loading branch information
Matt Bargar authored Oct 13, 2016
2 parents cbbf337 + 13ee3da commit f3a8721
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/public/agg_types/buckets/date_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default function DateHistogramAggType(timefilter, config, Private) {
makeLabel: function (agg) {
const output = this.params.write(agg);
const params = output.params;
return params.field + ' per ' + (output.metricScaleText || output.bucketInterval.description);
const field = params.field || _.get(agg, 'params.field.displayName', '');
return field + ' per ' + (output.metricScaleText || output.bucketInterval.description);
},
createFilter: createFilter,
decorateAggConfig: function () {
Expand Down

0 comments on commit f3a8721

Please sign in to comment.