Plotly JS Python跟踪名称标签已被切断

时间:2018-12-12 18:32:31

标签: plotly plotly.js

我如何确保没有删除我的跟踪名称标签?enter image description here

1 个答案:

答案 0 :(得分:0)

您可以通过以下方式使用namelength中的hoverlabel

plot_data = [go.Scatter(x = [1.,2,3], y = [10., 20, 30], name = 'Loremipsumdolorsitamet1',
                        hoverlabel = dict(namelength = 50))]
plot_data += [go.Scatter(x = [1.,2,3], y = [15., 25, 40], name = 'Loremipsumdolorsitamet2')]
pltly.iplot(plot_data)

此处有更多信息:https://plot.ly/javascript/reference/#scatter-hoverlabel

上面的代码将给出以下图表: enter image description here