Pass queryConfig down to Dygraphs so it can make label decisions

pull/10616/head
Andrew Watkins 2017-08-03 14:50:44 -07:00
parent 47b5f6cf4d
commit e11d2d38aa
2 changed files with 5 additions and 3 deletions

View File

@ -102,10 +102,11 @@ const Visualization = React.createClass({
const statements = queryConfigs.map(query => {
const text =
query.rawText || buildInfluxQLQuery(query.range || timeRange, query)
return {text, id: query.id}
return {text, id: query.id, queryConfig: query}
})
const queries = statements.filter(s => s.text !== null).map(s => {
return {host: [proxy], text: s.text, id: s.id}
return {host: [proxy], text: s.text, id: s.id, queryConfig: s.queryConfig}
})
return (

View File

@ -271,11 +271,12 @@ export default class Dygraph extends Component {
const y = _.get(axes, ['y', 'bounds'], [null, null])
const y2 = _.get(axes, ['y2', 'bounds'], undefined)
const timeSeries = this.getTimeSeries()
const ylabel = this.getLabel('y')
const updateOptions = {
labels,
file: timeSeries,
ylabel: this.getLabel('y'),
ylabel,
axes: {
y: {
valueRange: getRange(timeSeries, y, ruleValues),