Skip to content

Commit a4dc092

Browse files
committed
Add sensible default
1 parent 7cfec79 commit a4dc092

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/legend/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ legend.repositionLegend = function(td, traces){
682682
// Add scroll functionality
683683
var legendsvg = fullLayout._infolayer.selectAll('svg.legend'),
684684
scrollBox = fullLayout._infolayer.selectAll('svg.legend .scrollbox'),
685-
scrollheight = Math.min(80, legendheight);
685+
plotHeight = fullLayout.height - fullLayout.margin.t - fullLayout.margin.b,
686+
scrollheight = Math.min(plotHeight, legendheight);
686687

687688
scrollBox.attr('viewBox', '0 0 ' + legendwidth + ' ' + scrollheight);
688689
legendsvg.node().addEventListener('wheel', scrollHandler);

0 commit comments

Comments
 (0)