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.

Trace `legendItem` styles

See original GitHub issue

I’m thinking of adding a new trace attribute container: legenditem

{
  x: [/* */],
  y: [/* */],
  legenditem: {
    textfont: {
       color: 'red'
       size: 12
     },
     marker: {
       size: 20,
       symbol: 'circle',
       line: {width: 2, color: '#444'}
     }
  }
}

to the scatter*, bar* and pie traces to make their legend item styling configurable. This would be an easy (easier than @alexcjohnson 's legend 2.0 idea 😏 ) solution to https://github.com/plotly/plotly.js/issues/2967, https://github.com/plotly/plotly.js/issues/2080, https://github.com/plotly/plotly.js/issues/1701 and https://github.com/plotly/plotly.js/issues/1560


By the way, I’m thinking a naming this new container legenditem and not legend as I’m thinking legend could eventually be used when we implement multiple legends where e.g. legend: 'legend2' would mean “put this trace’s legend item in the second legend”.

One more note on @alexcjohnson 's legend 2.0 idea: having legenditem in traces wouldn’t make it obsolete. We could still add a way to turn annotations into legend items later.

Thoughts?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
kris16034commented, Apr 15, 2020

I know I am a random nobody Intruding on this conversation but I have a team of data analysts that want to switch to plotly but struggle with the legend versatility (we have a variety of complicated custom plots) 3732 would greatly help. Any plans to put this in ?

1reaction
etpinardcommented, Apr 5, 2019

Would this idea replace #3732 or would we still continue with that?

This ticket will augment (not replace) #3732

Read more comments on GitHub >

github_iconTop Results From Across the Web

Legends in Python - Plotly
Traces of most types can be optionally associated with a single legend item in the legend. Whether or not a given trace appears...
Read more >
How to change plotly legendstatus of trace n with a generic ...
Thanks to answers on this previous question, I have developed a plotly plot with buttons linked to its legend , where clicking the...
Read more >
legend - Jupyter Notebook - MyBinder
Legends support many styling options. ... Legend items appear per trace, and the legend item name is taken from the trace's name attribute....
Read more >
Legend - Plotly.NET
"false" disables legend item double-click interactions. ?ItemSizing : TraceItemSizing. Determines if the legend items symbols scale with their corresponding " ...
Read more >
HTML legend tag - W3Schools
Let the fieldset caption float to the right (with CSS):. <form action="/action_page.php"> <fieldset> <legend style="float:right">Personalia:</legend>
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