Position legend above the graph when it would otherwise go off the screen

pull/10616/head
Alex P 2017-09-27 10:54:05 -07:00
parent 16a55d3053
commit a0ad154ce0
1 changed files with 1 additions and 1 deletions

View File

@ -368,7 +368,7 @@ export default class Dygraph extends Component {
const isLegendBottomClipped = graphBottom + legendHeight > screenHeight
const legendTop = isLegendBottomClipped
? graphHeight + 8 - legendHeight
? -(legendHeight + 8)
: graphHeight + 8
this.legendRef.style.left = `${legendLeft}px`