【问题标题】:How to display hover info on a plotly Table?如何在绘图表上显示悬停信息?
【发布时间】:2020-10-13 18:39:29
【问题描述】:

我想在有情节的表格上显示悬停信息。这是我的最佳猜测,但在 jupyter 笔记本中或当图形导出为 html 并在浏览器中查看时,没有显示悬停文本:

import plotly.graph_objects as go

hover_text = [['hover a', 'hover b', 'hover c'],
              ['hover d', 'hover e', 'hover f']]

fig = go.Figure(data=[go.Table(
    cells={'values': [['a', 'b', 'c'],
                      ['d', 'e', 'f']]},
    hoverinfo='text',
    meta={'text': hover_text}
)])

fig.show()
fig.write_html('test.html')

情节版本 4.5.4

有许多 go.Table() 参数看起来可能是相关的,但我没有找到显示任何内容的组合:

  • 悬停信息
  • hoverinfosrc
  • 悬停标签
  • 元数据
  • 自定义数据
  • customdatasrc

我一直在看的一些参考资料:

【问题讨论】:

    标签: python plotly


    【解决方案1】:

    它似乎是一个文档错误,并且悬停目前不适用于表格。您可以查看有关此错误的 open git 问题: https://github.com/plotly/plotly.js/issues/5523

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-16
      • 2021-07-15
      • 2018-12-11
      • 1970-01-01
      • 2021-10-27
      • 1970-01-01
      • 2020-09-24
      • 1970-01-01
      相关资源
      最近更新 更多