Change resolution on graph resize
parent
5aeb32b75f
commit
4263a0dad0
|
@ -117,7 +117,7 @@ const AutoRefresh = ComposedComponent => {
|
||||||
const timeSeriesPromises = queries.map(query => {
|
const timeSeriesPromises = queries.map(query => {
|
||||||
const {host, database, rp} = query
|
const {host, database, rp} = query
|
||||||
|
|
||||||
const templatesWithResolution = templates.map((temp) => {
|
const templatesWithResolution = templates.map(temp => {
|
||||||
if (temp.tempVar === ':interval:') {
|
if (temp.tempVar === ':interval:') {
|
||||||
if (resolution) {
|
if (resolution) {
|
||||||
return {...temp, resolution}
|
return {...temp, resolution}
|
||||||
|
@ -175,7 +175,13 @@ const AutoRefresh = ComposedComponent => {
|
||||||
return this.renderNoResults()
|
return this.renderNoResults()
|
||||||
}
|
}
|
||||||
|
|
||||||
return <ComposedComponent {...this.props} data={timeSeries} setResolution={this.setResolution} />
|
return (
|
||||||
|
<ComposedComponent
|
||||||
|
{...this.props}
|
||||||
|
data={timeSeries}
|
||||||
|
setResolution={this.setResolution}
|
||||||
|
/>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,6 +194,7 @@ const AutoRefresh = ComposedComponent => {
|
||||||
<ComposedComponent
|
<ComposedComponent
|
||||||
{...this.props}
|
{...this.props}
|
||||||
data={data}
|
data={data}
|
||||||
|
setResolution={this.setResolution}
|
||||||
isFetchingInitially={isFirstFetch}
|
isFetchingInitially={isFirstFetch}
|
||||||
isRefreshing={!isFirstFetch}
|
isRefreshing={!isFirstFetch}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -7,7 +7,6 @@ import _ from 'lodash'
|
||||||
import Dygraphs from 'src/external/dygraph'
|
import Dygraphs from 'src/external/dygraph'
|
||||||
import getRange from 'shared/parsing/getRangeForDygraph'
|
import getRange from 'shared/parsing/getRangeForDygraph'
|
||||||
|
|
||||||
|
|
||||||
const LINE_COLORS = [
|
const LINE_COLORS = [
|
||||||
'#00C9FF',
|
'#00C9FF',
|
||||||
'#9394FF',
|
'#9394FF',
|
||||||
|
@ -309,6 +308,8 @@ export default class Dygraph extends Component {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
dygraph.resize()
|
dygraph.resize()
|
||||||
|
const {w} = this.dygraph.getArea()
|
||||||
|
this.props.setResolution(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
sync() {
|
sync() {
|
||||||
|
|
Loading…
Reference in New Issue