Trace `legendItem` styles
See original GitHub issueI’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:
- Created 4 years ago
- Reactions:4
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
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 ?
This ticket will augment (not replace) #3732