【发布时间】:2016-07-12 11:57:12
【问题描述】:
【问题讨论】:
【问题讨论】:
我可能有点晚了,但我找到了解决方案
将hoverlabel: {namelength :-1} 添加到我的跟踪对象中就可以了。
来自Here
【讨论】:
update_layout调用中,并且在该实例中上述格式为hoverlabel_namelength=-1
您可能已经找到了答案,但是:
通过设置“文本”并将其传递给您的 hoverinfo。 在你的例子中,如果你设置 text='CollegeClass' 并设置你的 hoverinfo = 'text' 你会得到你期望的结果。 似乎跟踪的名称被截断,而您传递的文本或标签却没有。
data = [
go.Scatter(
x=[0, 1, 2],
y=[1, 3, 2],
mode='markers',
text=['Text A', 'Text B', 'Text C']
hoverinfo = 'text'
)]
复制自 https://plot.ly/python/text-and-annotations/#adding-hover-text-to-data-in-line-and-scatter-plots 并不是说在我的情况下我必须设置 hoverinfo = 'text' 而在示例中它似乎没有工作。
【讨论】: