Fix incorrect positioning of labels on initial render
parent
3cf39ed80a
commit
ec8668083c
|
@ -159,12 +159,11 @@ export default React.createClass({
|
|||
: overrideLineColors
|
||||
|
||||
return (
|
||||
<div className={`dygraph ${this.yLabelClass()}`} style={{height: '100%'}}>
|
||||
<div className="dygraph graph--hasYLabel" style={{height: '100%'}}>
|
||||
{isRefreshing ? this.renderSpinner() : null}
|
||||
<Dygraph
|
||||
axes={axes}
|
||||
queries={queries}
|
||||
dygraphRef={this.dygraphRefFunc}
|
||||
containerStyle={{width: '100%', height: '100%'}}
|
||||
overrideLineColors={lineColors}
|
||||
isGraphFilled={showSingleStat ? false : isGraphFilled}
|
||||
|
@ -195,26 +194,6 @@ export default React.createClass({
|
|||
)
|
||||
},
|
||||
|
||||
yLabelClass() {
|
||||
const dygraph = this.dygraphRef
|
||||
|
||||
if (!dygraph) {
|
||||
return 'graph--hasYLabel'
|
||||
}
|
||||
|
||||
const label = dygraph.querySelector('.dygraph-ylabel')
|
||||
|
||||
if (!label) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return 'graph--hasYLabel'
|
||||
},
|
||||
|
||||
dygraphRefFunc(dygraphRef) {
|
||||
this.dygraphRef = dygraphRef
|
||||
},
|
||||
|
||||
renderSpinner() {
|
||||
return (
|
||||
<div className="graph-panel__refreshing">
|
||||
|
|
Loading…
Reference in New Issue