From a0ad154ce00a05a72b5d39d089177aaf90f180eb Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 27 Sep 2017 10:54:05 -0700 Subject: [PATCH] Position legend above the graph when it would otherwise go off the screen --- ui/src/shared/components/Dygraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/shared/components/Dygraph.js b/ui/src/shared/components/Dygraph.js index 3dc1dfb5c4..437f0e5759 100644 --- a/ui/src/shared/components/Dygraph.js +++ b/ui/src/shared/components/Dygraph.js @@ -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`