Skip to content
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

Incorrect legend style with x unify hovermode #4882

Open
FabioMosella opened this issue Nov 15, 2024 · 0 comments
Open

Incorrect legend style with x unify hovermode #4882

FabioMosella opened this issue Nov 15, 2024 · 0 comments
Labels
bug something broken P3 backlog

Comments

@FabioMosella
Copy link

Hello

I noticed that something is incorrect with the legend styling, especially when we use the x unify hovermode.

Here is a short example:

import plotly.graph_objects as go

x = ["A", "B"]
fig = go.Figure(data=[
    go.Bar(
        x=x, 
        y=[1, 1],
        marker=dict(color=["blue", "red"], pattern_shape=["/", ""]),
        name="First Bar"
    ),
    go.Bar(
        x=x, 
        y=[-1, -1],
        marker=dict(color=["green", "purple"], pattern_shape=["/", ""]),
        name="Second Bar",
    ),
])

fig.update_layout(hovermode="x unified")
fig.show()

Image

As we can see, the second bar uses the "general" legend style, which leads to an incorrect style for the items on the right.
plotly version = 5.24.1

And thank you for your amazing work!

@gvwilson gvwilson added bug something broken P3 backlog labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants