Skip to content

go.Bar zorder parameter ignored on Chart Studio #4941

Open
@alexhewson

Description

@alexhewson

Issue
I am trying to produce a simple two trace horizontal bar chart, making use of the overlay barmode, which is uploaded to Chart Studio and then embeded on a website.

When my script is run to display offline with fig.show() my two traces appear in the desired order, respecting the zorder arguments that I've set. However, when uploaded to Chart Studio with py.plot(fig) the zorder parameter is ignored, hiding one of the traces.

Image

Expected behaviour
zorder arguments should be respected, with the higher value being placed on top.

Image

Code snippet

fig = go.Figure(
    go.Bar(
        x=[1, 2, 3],
        y=[0, 1, 2],
        orientation='h',
        zorder=1
    ),
)
fig.add_trace(
    go.Bar(
        x=[3, 4, 5],
        y=[0, 1, 2],
        orientation='h',
        zorder=0
    )
)

fig.update_layout(
    title_text=f"{plotly.__version__ = }",
    barmode='overlay',
    hovermode='closest')

py.plot(fig)

I'm developing in VS Code with jupyter notebook and a script, and both produce the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions