Reputation: 47
My hoverData
returns an object like this:
{
'points': [{
'curveNumber': 3,
'pointNumber': 25,
'pointIndex': 25,
'x': ' 2017 Feb',
'y': 0.98
}]
}
code:
@app.callback(dash.dependencies.Output("div_table1", 'children'),
[dash.dependencies.Input('graph1', 'hoverData')])
def update_table1(hover_graph1):
print(hover_graph1)
Is it a list?
How can I get the x value ' 2017 Feb'
from it?
Upvotes: 0
Views: 314
Reputation: 1789
It's a nested dictionary, so you just need to do this:
hover_graph1['points'][0]['x']
Upvotes: 2