【问题标题】:How to custom the display content while one node was selected in Plotly Dash如何在 Plotly Dash 中选择一个节点时自定义显示内容
【发布时间】:2021-06-22 01:53:06
【问题描述】:

我在 Dash 应用程序中有一个 Plotly Express 图表。是否可以自定义悬停标签的内容(当我将光标移到数据点上时出现)

见下图:

【问题讨论】:

  • 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”]、“用户”:[4、21、2、100],“系统”:[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: Python的Web应用框架。'''), dcc.Graph( id='example-graph', figure =fig ) ])
  • 悬停文本记录在 Plotly Python 文档中:plotly.com/python/hover-text-and-formatting
  • 太好了,非常感谢。

标签: python plotly plotly-dash


【解决方案1】:

好的,看来可以使用 hover_name 参数来解决这个问题。

【讨论】:

    猜你喜欢
    • 2014-10-15
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 2018-07-15
    • 1970-01-01
    相关资源
    最近更新 更多