Skip to content

zorder doesn't work on version 5.21.0 #4583

Closed
@khisr0w

Description

@khisr0w

The zorder attribute was added recently. However, the following code does not work as expected (exact code as here):

import plotly
import plotly.graph_objects as go

fig = go.Figure(
    go.Bar(
        x=[0, 1, 2],
        y=[1, 2, 3]
    ),
)
fig.add_trace(
    go.Scatter(
        x=[0, 1, 2],
        y=[3, 2, 1],
        zorder=-2
    )
)

fig.update_layout(
    title=dict(text=f"{plotly.__version__ = }")
)
fig.show()

Expected Behavior: Bar chart should have a higher z-order, meaning it should be at the front.
Instead, the code produces the following:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions