Skip to content

Horizontal legend traces wrap to new lines #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 2, 2016
Prev Previous commit
Next Next commit
need both margins for proper wrapping
  • Loading branch information
psalmody committed Jul 25, 2016
commit e7a286fc4abdbd04da39ee21e5b4e6977a1719db
2 changes: 1 addition & 1 deletion src/components/legend/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ function computeLegendDimensions(gd, groups, traces) {
traceWidth = 40 + legendItem.width,
traceGap = opts.tracegroupgap || 5;

if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout.width - fullLayout.margin.r) {
if((borderwidth + offsetX + traceGap + traceWidth) > (fullLayout.width - (fullLayout.margin.r + fullLayout.margin.l))) {
offsetX = 0;
rowHeight = rowHeight + maxTraceHeight;
opts.height = opts.height + maxTraceHeight;
Expand Down