question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hide missing data from hover tooltip

See original GitHub issue

I 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.

Screen Shot 2021-12-14 at 13 16 13

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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
yaelbhcommented, Aug 25, 2022

I also have the same problem. Will be nice if the package owners will give it high priority.

0reactions
lijecarucommented, Aug 18, 2022

Is there any development on this issue? I would also like my hovertip to skip that specific customdata if it’s np.nan

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found