question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontal legend items not visible when many legend items

See original GitHub issue

Was pointed out in #766 that scrolling not intended for layout.legend.orientation = 'h'. Example workaround is to use legend groups.

This is not a great solution, however, as it means clicking the legend group hides/shows ALL traces in the group (see jsfiddle).

Proposing that plotly.js implement something similar to ggplot2 which automatically wraps additional legend items on horizontal legend orientation. Especially on mobile portrait orientation, this allows the graph data to take up the entire width of the screen and push the legend below the graph which is much preferable in my view. kpi-2-raceretention

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
etpinardcommented, Jul 22, 2016

I did notice that but decided it’s probably more complicated than it’s worth

Yeah. I agree. Your solution sounds like a solid fallback for extra-wide legends. If ever some users want a more fine-grained legend layout, we could always add support for something like:

layout.legend = {
  type: 'grid',
  grid: [ [ 'trace 0', 'trace 1', 'trace 2'], ['trace 4', 'trace 3'] ]
};

down the road.

@n-riesco what do you think?

0reactions
adibiasiocommented, Jun 15, 2020

Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing a legend from vertical to horizontal - Esri Community
I have a simple legend that I'd like to display horizontally, across the bottom of an mxd. I could convert each element to...
Read more >
Work with a legend item—ArcGIS Pro | Documentation
Legend items always display the legend patch set for the feature layer. You can change the patch by adjusting the layer's symbology. Legend...
Read more >
Matplotlib: how to show legend elements horizontally?
I'd like to set the legend to be displayed horizontally. I do not mean the text of the legend like described in the...
Read more >
How do I get legends to show horizontally across at the bottom ...
I have already tried making the legend container "floating"" and also choosing to arrange items in a single row. The problem that I...
Read more >
QGIS legend horizontal not vertical - GIS Stack Exchange
In QGIS 2+ legend items can be arranged in columns. enter image description here.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found