Add comments to workaround for legend disappear on redraw
parent
791a694c79
commit
c93c8ac6de
|
@ -30,7 +30,7 @@ export default class Dygraph extends Component {
|
||||||
isSynced: false,
|
isSynced: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround for dygraph.updateOptions breaking legends
|
// optional workaround for dygraph.updateOptions breaking legends
|
||||||
// a la http://stackoverflow.com/questions/38371876/dygraph-dynamic-update-legend-values-disappear
|
// a la http://stackoverflow.com/questions/38371876/dygraph-dynamic-update-legend-values-disappear
|
||||||
// this.lastMouseMoveEvent = null
|
// this.lastMouseMoveEvent = null
|
||||||
// this.isMouseOverGraph = false
|
// this.isMouseOverGraph = false
|
||||||
|
@ -106,6 +106,7 @@ export default class Dygraph extends Component {
|
||||||
unhighlightCallback: () => {
|
unhighlightCallback: () => {
|
||||||
legendContainerNode.className = 'container--dygraph-legend hidden' // hide
|
legendContainerNode.className = 'container--dygraph-legend hidden' // hide
|
||||||
|
|
||||||
|
// part of optional workaround for preventing updateOptions from breaking legend
|
||||||
// this.isMouseOverGraph = false
|
// this.isMouseOverGraph = false
|
||||||
},
|
},
|
||||||
highlightCallback: e => {
|
highlightCallback: e => {
|
||||||
|
@ -143,6 +144,7 @@ export default class Dygraph extends Component {
|
||||||
legendContainerNode.style.left = `${legendLeft}px`
|
legendContainerNode.style.left = `${legendLeft}px`
|
||||||
legendContainerNode.style.top = `${legendTop}px`
|
legendContainerNode.style.top = `${legendTop}px`
|
||||||
|
|
||||||
|
// part of optional workaround for preventing updateOptions from breaking legend
|
||||||
// this.isMouseOverGraph = true
|
// this.isMouseOverGraph = true
|
||||||
// this.lastMouseMoveEvent = e
|
// this.lastMouseMoveEvent = e
|
||||||
},
|
},
|
||||||
|
@ -214,6 +216,7 @@ export default class Dygraph extends Component {
|
||||||
underlayCallback: options.underlayCallback,
|
underlayCallback: options.underlayCallback,
|
||||||
series: dygraphSeries,
|
series: dygraphSeries,
|
||||||
})
|
})
|
||||||
|
// part of optional workaround for preventing updateOptions from breaking legend
|
||||||
// if (this.lastMouseMoveEvent) {
|
// if (this.lastMouseMoveEvent) {
|
||||||
// dygraph.mouseMove_(this.lastMouseMoveEvent)
|
// dygraph.mouseMove_(this.lastMouseMoveEvent)
|
||||||
// }
|
// }
|
||||||
|
|
Loading…
Reference in New Issue