Skip to content

Customize Boxplot hoverinfo #3334

Open
Open
@jwiemer112

Description

@jwiemer112

Is it possible to customize the hoverinfo of boxplots? Instead of showing the x-axis value infront of q1, q3, mean, etc..I want to change the value for the 'x-axis on the hover info. I thougt that this is possible with customdata but if I use it only the standard informations are displayed.


import plotly.graph_objects as go

x = ['day 1', 'day 1', 'day 1', 'day 1', 'day 1', 'day 1',
     'day 2', 'day 2', 'day 2', 'day 2', 'day 2', 'day 2']

fig = go.Figure()
meta=[0,1,2,3]
fig.add_trace(go.Box(
    y=[0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3],
    x=x,
    name='kale',
    marker_color='#3D9970',
    customdata=[0, 0, 0 ,0 ,0 ,0, 1, 1, 1, 1, 1, 1],
    hovertemplate='x:%{customdata}'
))

fig.show(renderer='browser')

I want that in the hovrinfo it says 0 insead of 'day 1' and 1 instead of 'day 2' for example.

Greetz Jan :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions