Closed jd-lara closed 2 years ago
It is not clear what you expect to be displayed relative to the trace name. If you define
Layout(width=600, height=450, showlegend=true)
then the trace name will be displayed in legend. When a plot has a single trace in its definition the trace name is not displayed on hover, because there is no reason for confusion. But if add two traces:
using PlotlyJS
s = scatter(;x=1:5, y=[1, 6, 3, 6, 1],
mode="markers", name="Team A",
text=["A-1", "A-2", "A-3", "A-4", "A-5"],
marker_size=12)
pl = Plot(s, Layout(width=600, height=400, showlegend=true))
addtraces!(pl, scatter(x=LinRange(1, 5, 7), y=rand(2:9, 7), mode="lines",
name="trace name"))
display(pl)
then their names are displayed both on legend and on hover:
Adding name to a scatter stopped working
MWE
Results in