Skip to content

Waterfall plot doesn't always plot the right axis range #2327

Description

@AndreCNF

Depending on the data values, when setting a base (i.e. initial value), the plot doesn't always adjust the axis range accordingly. For instance, where's a plot working as expected:

import plotly.graph_objs as go
fig = go.Figure()

fig.add_trace(go.Waterfall(
    y = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'],
    x = [1, 2, 3, -2, -1, 3, -4, 1],
    base = 100,
    orientation='h'
))

fig.show()

image

Now here's what happens when I change a single value in the data (in this case, I changed the third value from 3 to 1):

import plotly.graph_objs as go
fig = go.Figure()

fig.add_trace(go.Waterfall(
    y = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'],
    x = [1, 2, 1, -2, -1, 3, -4, 1],
    base = 100,
    orientation='h'
))

fig.show()

image

I'm using plotly 4.5.4 and python 3.7.4

Can anyone help me understand what I might be doing wrong or fix this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions