Update label to handle new field shapes

pull/10616/head
Andrew Watkins 2017-11-28 12:46:01 -05:00
parent eee830979f
commit ad9eb6d632
1 changed files with 5 additions and 7 deletions

View File

@ -110,11 +110,9 @@ function getRolesForUser(roles, user) {
} }
export const buildDefaultYLabel = queryConfig => { export const buildDefaultYLabel = queryConfig => {
return queryConfig.rawText const {measurement, fields} = queryConfig
? '' const fieldAlias = `${_.get(fields, ['0', 'alias'], '')}`
: `${queryConfig.measurement}.${_.get( const field = `${_.get(fields, ['0', 'value'], '')}`
queryConfig,
['fields', '0', 'field'], return `${measurement}.${fieldAlias || field}`
''
)}`
} }