Fix bug with Dygraph legend not rendering until rerender triggered

pull/3268/head
Iris Scholten 2018-04-20 17:00:08 -07:00
parent 6be23bcfa3
commit 599afef517
1 changed files with 8 additions and 6 deletions

View File

@ -295,13 +295,15 @@ class Dygraph extends Component {
return (
<div className="dygraph-child">
{this.areAnnotationsVisible && (
{this.dygraph && (
<div className="dygraph-addons">
<Annotations
dygraph={this.dygraph}
dWidth={this.dygraph.width_}
staticLegendHeight={staticLegendHeight}
/>
{this.areAnnotationsVisible && (
<Annotations
dygraph={this.dygraph}
dWidth={this.dygraph.width_}
staticLegendHeight={staticLegendHeight}
/>
)}
<DygraphLegend
cellID={cellID}
dygraph={this.dygraph}