mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backport PR #8646
---------
**Commit 1:**
Fix label on scripted field date histograms
Now that we support Painless scripted fields users can create scripted
date fields, and thus scripted date histograms. The label making method
for the date histogram agg was getting the field name in a way that was
incompatible with scripted fields, so I've added some fallback code for
that scenario. I looked through the rest of the makeLabel methods on all
the other aggs and they all correctly access the field displayName
already so this should only need fixed for date histograms.
Now with more lodash for safer access
Fixes elastic#8632
* Original sha: fc635bcf2f
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-12T22:30:15Z
This commit is contained in:
parent
cbbf337313
commit
13ee3daa2c
1 changed files with 2 additions and 1 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue