是的,您可以使用
hovertext元素来执行此操作。文件
import plotly.graph_objs as gofrom plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplotinit_notebook_mode(connected=True)hoverinformation = ["test", "test2", "test3", "test4"] # this info I would like it on hoverdata = []for index, item in enumerate(range(1,5)): data.append( go.Bar( x="da", y=[item], hovertext=hoverinformation[index], # needs to be different than the hover info text=[item], hoverinfo="text", name="example {}".format(index), # <- different than text textposition="auto", ) )layout = go.Layout( barmode='stack',)iplot({ "data": data, "layout": layout})


