-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
px.bar: when base is used, hoverlabel label should be "base+y: %y" #2786
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
Comments
I just noticed the following: If I add x as explicit hover_data, it changes the hover data to the correct one: px.bar(tasks, base='Start', y='Elapsed', text='Task',) # left
px.bar(tasks, base='Start', y='Elapsed', text='Task', hover_data=['Elapsed']) # right Maybe the second behaviour can be made default? |
This behaviour (at the Plotly.js level) is intentional: when When you pass in |
That said, |
I agree with not changing plotly.js, this is only about px.bar
This is good enough since it prevents confusion and makes it more obvious than adding |
That's a good idea but the implementation under the hood is a bit more complicated :) |
@nicolaskruchten I have been trying to pass in text to go.bar to avoid the effects of setting a base on an offset stacked bar chart but with no luck.
or
Is there anything I'm missing? Cheers |
So the required code in the end works but removes all label text on the actual bars 😞 Is there any way to keep the labels on the bars?
I also had to remove this line I also wonder is this the most effective and CPU efficient way to do it? I feel like these lines to replicate what could be default seems unusual? Ref: https://dev.to/fronkan/stacked-and-grouped-bar-charts-using-plotly-python-a4p |
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Alternatively, if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
Minimal example:
Imagine an horizontal gantt-chart where
x=Elapsed
is Task duration in days. The issue is that Task C has "Elapsed=15" instead of "Elapsed=10".This also an issue in the
graph_objects
API in the default hover, but at least adding x as text shows the proper one.Note: In
px.timeline
it's fine since user must giveFinish=
but inpx.bar
it's looks pretty misleading to "change" x into finish :-)If my Task lasts 10 days, the fact that it ends at day 15 is an internal positioning detail.
@nicolaskruchten is it just an oversight from #2585 or do you intend it this way?
The text was updated successfully, but these errors were encountered: