Fix incorrect positioning of labels on initial render

pull/10616/head
Andrew Watkins 2017-08-22 10:03:06 -07:00
parent 3cf39ed80a
commit ec8668083c
1 changed files with 1 additions and 22 deletions

View File

@ -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">