0
votes

I have a Plotly Express graph inside a Dash app. Is it possible to customize the content of the hover label (which appears when I move my cursor over a data point)

See image below:

enter image description here

1
external_stylesheets = ['codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(name, external_stylesheets=external_stylesheets) df = pd.DataFrame({ "time": ["5-6-1", "5-6-2", "5-6-3","5-6-4"], "user": [4, 21, 2, 100], "system": [96, 79, 98, 0], }) fig = px.line(df, x='time', y=['user', 'system'], title='testing ') app.layout = html.Div(children=[ html.H1(children='Hello Dash'), html.Div(children=''' Dash: A web application framework for Python. '''), dcc.Graph( id='example-graph', figure=fig ) ])Billy Chen
Hover text is documented in the Plotly Python Docs: plotly.com/python/hover-text-and-formattingxhlulu
great ,thanks a lot.Billy Chen

1 Answers

0
votes

okay, it looks like hover_name parameter can be used to resolve this problem.