plotly.js: [Bug] Horizontal Legend Wrapping doesn't account properly for usage of
tags
Reproduction:
- Set screen size so narrow that all legend items will be displayed in a vertical fashion, with
legend.orientation = "h"
. - Create two traces where the first one has a very long name that will make the second trace’s name wrap into the next line and do not use
<br>
in the first traces name. - Put at least one
<br>
in the second trace’s name.
Here’s an example: https://codepen.io/anon/pen/EdJyQm?editors=0010
If you put a <br>
anywhere in the name of trace6, the name of trace7 will be shown fine.
If you leave it out and your last trace contains a <br>
the second line will be cut off.
Please ping me up if you need further explanation of the problem.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (5 by maintainers)
Commits related to this issue
- Merge pull request #3446 from plotly/horiz-legend-wrap-all-lines-fix Fix wrapped horizontal legends height computations — committed to plotly/plotly.js by etpinard 5 years ago
Just for the record: I found another problem with this. If you have
<br>
in yourtrace.name
the white background doesn’t follow properly and the name collides with the next trace:https://github.com/plotly/plotly.js/pull/3024 might be enough to fix this.
Hey, everyone. Just wanted to know if anyone of the contributors/members has read this, since it isn’t labeled and there’s no comment yet =(…