Skip to content

Hover support show multiple column  #1714

@eromoe

Description

@eromoe

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions