Reputation: 181
I am using pandas to generate the data for my plotly scatter plot. However when I try to convert a column to a list for the hoverinfo I am unable to successfully compile.
I am using the list function. I have also tried data['id'].values, and data['id'].tolist.
hoverList = list(data.id)
display = go.Scatter(
x = data['x_data'],
y = data['y_data'],
hoverinfo = 'hoverList',
mode = 'markers',
name = "data",
marker = dict(
size = 6,
color = 'rgba(76, 224, 128, 0.79)'
)
)
Output recieved:
Invalid value of type 'builtins.str' received for the 'hoverinfo' property of scatter Received value: 'hoverList'
Upvotes: 4
Views: 8526
Reputation: 181
I solved the problem. It looks like the hoverinfo paramater can only be 'x', 'y', 'z', 'text', or a few other specified commands. Here is the code that compiled:
display = go.Scatter(
x = data['x_data'],
y = data['y_data'],
text = data['id'],
hoverinfo = 'text',
mode = 'markers',
name = "data",
marker = dict(
size = 6,
color = 'rgba(76, 224, 128, 0.79)'
)
)
Upvotes: 8