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

Display tooltips on zero value bars #6988

Open
moxboxwa opened this issue Apr 29, 2024 · 2 comments
Open

Display tooltips on zero value bars #6988

moxboxwa opened this issue Apr 29, 2024 · 2 comments

Comments

@moxboxwa
Copy link

This is a follow-up to #3797 .

I am using ggplotly in R, not using plotly directly, so I'm not including a reproducible example, but I think the issue is straightforward.

The tooltip (using the "text" specified in the ggplot command) does not appear in barplots when the bar height is equal to 0. The issue cited above notes the same thing in the last comment, posted after that issue had been resolved/closed.

If the tooltip only included the value of the bar height, this would not be a problem. But we often use the tooltip to display multiple values. In my specific case, the bar height shows year-to-year percentage change for each state, and the tooltip includes both the pct chg and the raw number for the current year. The raw number provides useful interpretive context because there is a wide range of raw values, and small values lead to more variable/extreme pct changes. For the states with pct chg=0, no tooltip is shown, so we lose the information on raw number that would help provide context. Screenshot below for example.

image

Thanks!

@archmoj
Copy link
Contributor

archmoj commented Apr 29, 2024

Do you know which version of plotly.js is used there?
You may see it by hovering over the Plotly icon on the modebar.

@moxboxwa
Copy link
Author

@archmoj it's v2.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants