textarea’s documentation states that the keyword title
is used for “Text to be displayed in a tooltip when hovering over the element.
” So, I thought of attaching a figure instead to title
like so:
data = [
{
'values': [[10,90],[5, 95],[15,85],[20,80]],
'type': 'pie',
},
]
fig = dcc.Graph(
id='graph',
figure={
'data': data,
'layout': {
'margin': {
'l': 30,
'r': 0,
'b': 30,
't': 0
},
'legend': {'x': 0, 'y': 1}
}
}
)
dcc.Textarea(value='Some text', title=fig)
But this doesn’t display the pie diagram upon hovering over the textarea. It just displays [object Object]
upon hovering over the textarea.
Is there any way to do this? I understand I can implement a button and use on-click to display the graph, but I want it to be simple interface for the app without clicks, if possible.