-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
add trace legendItem
styles
#3735
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
Comments
Oh sure, if legends 2.0 ever happens it would play just fine with this. Great idea 💯 |
Would this idea replace #3732 or would we still continue with that? |
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 ? |
@etpinard I know this is an older ticket but it's still a limitation for us. In our case, we have traces with multiple symbols. Right now, the legend symbol is always whatever symbol is used for the first point, which is quite confusing to our users. It would be great to have the option to specify the legend marker as you outlined in your initial comment. Any chance this will get implemented in the near future? |
Honestly even an option to just always use a standard circle would work for us, if exposing all the other style options would be significant work. Maybe just an |
…which uses a circle symbol for all legend entries.
… in theory the user could now specify any valid symbol name.
…which uses a circle symbol for all legend entries.
… in theory the user could now specify any valid symbol name.
…which uses a circle symbol for all legend entries.
… in theory the user could now specify any valid symbol name.
This was an issue for a plot where I put a border around the bar with the highest value. To avoid getting a border around the legend item when the first bar is the winner, I just added buffers ([' '] and [0]) to the x and y vectors and set the xaxis range to [1:len(y)]. Not ideal, but it let me keep my square legend items, consistent with other plots. |
Any developments on this question? I can offer the following as a use case: Within each trace I color markers and marker borders according to various criteria—but this means that when the legend is generated, marker colors and borders come out in odd combinations. It would be ideal to be able to set the legend marker color and border manually. (I should mention that the above is with plotly.py.) |
Any updates on this issue? |
One workaround is to update the DOM after the graph is rendered, e.g. this sets all icons to a circle (even if the first item in the trace is e.g. a square):
|
I'm thinking of adding a new trace attribute container:
legenditem
to the
scatter*
,bar*
andpie
traces to make their legend item styling configurable. This would be an easy (easier than @alexcjohnson 's legend 2.0 idea 😏 ) solution to #2967, #2080, #1701 and #1560By the way, I'm thinking a naming this new container
legenditem
and notlegend
as I'm thinkinglegend
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?
The text was updated successfully, but these errors were encountered: