Hide missing data from hover tooltip
See original GitHub issueI have a dataframe column with some missing values which I want to include in hover_data
. Is it possible to show the column in the hover tooltip only if there’s value for the currently hovered point? The current default behavior is to show col_name=%{customdata[0]}
for missing values. I think it would be better to show nothing at all.
import plotly.express as px
df = px.data.gapminder().query("continent=='Oceania'")
df["pop"] = None
fig = px.line(
df,
x="year",
y="lifeExp",
color="country",
hover_data=["pop"],
title="layout.hovermode='closest' (the default)",
)
fig.update_traces(mode="markers+lines")
fig.show()
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Bokeh - Do not show tooltip if it has missing value
I see two ways of doing this: 1. Checking if Name is None with Python and using multiple HoverTool.
Read more >How to hide Tooltip Attributes that have don't have values
However, for some attributes, a few states have no values. I was wondering if it is possible to hide attributes where there is...
Read more >Tooltips on visual types in QuickSight - AWS Documentation
If you don't want tooltips to appear when you hover your cursor over data in a visual, you can hide them. ... Choose...
Read more >Tooltip | Components - BootstrapVue
Programmatically show and hide tooltip ... You can manually control the visibility of a tooltip via the syncable Boolean show prop. Setting it...
Read more >How to turn off Function Argument ToolTips in Excel - Office
Click to clear the Function tooltips check box, and then click OK. How to turn off function argument ToolTips in Microsoft Office Excel...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also have the same problem. Will be nice if the package owners will give it high priority.
Is there any development on this issue? I would also like my hovertip to skip that specific customdata if it’s np.nan