Improve performance of highlightCallback

pull/10616/head
Andrew Watkins 2017-12-04 15:21:14 -08:00
parent de302999fa
commit 1692a754a2
1 changed files with 3 additions and 3 deletions

View File

@ -355,7 +355,8 @@ export default class Dygraph extends Component {
}
highlightCallback = ({pageX}) => {
this.setState({isHidden: false, pageX})
this.pageX = pageX
this.setState({isHidden: false})
}
legendFormatter = legend => {
@ -381,7 +382,6 @@ export default class Dygraph extends Component {
render() {
const {
legend,
pageX,
sortType,
isHidden,
isSnipped,
@ -396,7 +396,7 @@ export default class Dygraph extends Component {
{...legend}
graph={this.graphRef}
legend={this.legendRef}
pageX={pageX}
pageX={this.pageX}
sortType={sortType}
onHide={this.handleHideLegend}
isHidden={isHidden}