0

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?

1 Answer 1

2

It's a nested dictionary, so you just need to do this:

hover_graph1['points'][0]['x']
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.