我想在绘图表上显示悬停信息。这是我最好的猜测,但是在 jupyter notebook 中或当图形导出到 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')
Run Code Online (Sandbox Code Playgroud)
情节版本 4.5.4
有许多 go.Table() 参数看起来可能是相关的,但我没有找到显示任何内容的组合:
我一直在看的一些参考资料: