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.

Hover support show multiple column

See original GitHub issue

I didn’t found a way to do this .

As I saw, plotly only support show 3 column when hovering, and 2 of them must be x and y . The example is

import plotly.express as px

gapminder = px.data.gapminder().query("year==2007 and continent=='Americas'")

fig = px.scatter(gapminder, x="gdpPercap", y="lifeExp", text="country", log_x=True, size_max=60)

fig.update_traces(textposition='top center')

fig.update_layout(
    height=800,
    title_text='GDP and Life Expectancy (Americas, 2007)'
)

fig.show()

But how do I make it show 6 column while hovering ??

In bokeh I can use tooltips to do this, example :

p = figure(title=title,
           x_range=x_range, y_range=y_range,
           x_axis_location="above",   plot_width=width, plot_height=len(y_range)*20,
           tools=TOOLS, toolbar_location='below',
           tooltips=[('name','@product_name'),('code', '@product_code'), ('date', '@date'), ('sc', '@sale_count'), ('pc', '@pred_count'), ('acc', '@acc%')])

p.rect(x=xcol, y=ycol, width=1, height=1,
   source=df,
   fill_color={'field': 'acc', 'transform': mapper},
   line_color=None)

At this point , bokeh is much more better than plotly .

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eromoecommented, Aug 9, 2019

Above is single column situation .

It just showed nothing when use 4 column , looks like if there is a nan value in ['price_plan_market', 'price_plan_store', 'price_flashsale', 'price_guide'] then wouldn’t show hover . This is the test csv 1.txt

p2 = pd.read_csv('1.txt')
fig = px.bar(p2, x="ds", y="sale_count", 
                 hover_name="ds", hover_data=['price_plan_market', 'price_plan_store', 'price_flashsale', 'price_guide'])

fig.update_layout(
    width=800,
    height=400,
)

fig.show()

0reactions
patilabhay679commented, Jul 22, 2022

have you tried converting nan to 0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text hover to image with multiple columns and fixed image in ...
1 Answer 1 · In the first instance I would replace the table component with a Layout called a flex box This would...
Read more >
CSS3 Multiple Column Hover Bug - CSS-Tricks
The issue i am having is on firefox, when the page loads it puts all items except one in the first column, and...
Read more >
Tool tip to table value hover display another two
Hi How to find Tool tip to table value hover display another two column values in same table? In Format , we enable...
Read more >
How to set up HoverTool for multiple columns with hvPlot?
I was trying to plot multiple columns as Y asix with hvPlot and use hover tooltip to show the value of the column...
Read more >
Reveal Widgets on Column Hover - No Plugin - YouTube
When you hover on a column, one or many items can appear.Add this CSS to the Column, and ensure that you name the...
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