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

Hover template for chart with "base" #5075

Open
Krowryy opened this issue Mar 10, 2025 · 2 comments
Open

Hover template for chart with "base" #5075

Krowryy opened this issue Mar 10, 2025 · 2 comments
Labels
bug something broken P2 considered for next cycle

Comments

@Krowryy
Copy link

Krowryy commented Mar 10, 2025

Hello!

I am creating a figure which is a Waterfall chart.

In this Waterfall chart, I am using the ‘base’ parameter.

This works perfectly for me, but I noticed a problem with the hovertemplate…
As soon as I have data below my ‘base’, the hover doesn’t work well… It doesn’t work when I am on the bar, I will let you see this in the video.

Here is the code:

import plotly.graph_objects as go

x_values = ['Waiting on union or regulatory problem', 'Up log wireline to depth inside drillstring',
                'Drill to depth', 'Slickline run other activities', 'Service Well Control Equipment',
                'Trip in to depth', 'Trip out to depth', 'Run in casing to depth', 'Drilling run other activities',
                'Rig up to run slickline', 'Run in slickline to depth', 'Make up BHA', 'Circulate to condition hole',
                'Waiting on cement to develop strength', 'Circulate to condition drilling fluid',
                'Smallest differences combined']
y_values = [-4.83333333, 1.14583333, 1.125, 1.08333333, 0.75, 0.5625, 0.5, -0.45833333, 0.41666667, 0.375, 0.35416667, -0.33333333, 0.33333333, -0.33333333, 0.29166667, 0.875]

fig = go.Figure(
        go.Waterfall(
            orientation="v",
            base=17.5625,
            x=x_values,
            y=y_values,
            customdata=y_values,
            hovertemplate=(
                    "%{x}<br>" + "Initial: %{initial:.2f}<br>" + "Final: %{final:.2f}<br>" + "Delta: %{delta:.2f}<extra></extra>"
            ),
        ),
        layout={"height": 800}    

    )
fig.show()

Link bug in forum with the video : https://community.plotly.com/t/hover-template-for-chart-with-base/90887/3

Thanks!

@gvwilson gvwilson added bug something broken P2 considered for next cycle labels Mar 11, 2025
@gvwilson
Copy link
Contributor

Thanks for the detailed bug report @Krowryy - I'll see if we can find someone to look at this in an upcoming work cycle, but it may be a while…

@Krowryy
Copy link
Author

Krowryy commented Mar 11, 2025

Hello @gvwilson , thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

2 participants