plotly dash display graph_objects pie chart inside html elemet

876 Views Asked by At

I am trying to display pie chart inside html div as below:

html.Div([
go.Figure(data=Piedata)
])

I got an error:

“An object was provided as children instead of a component, string, or number (or list of those). Check the children property”

If I try to display the same chart in a separate file using .show() it works, but when I try to display it in the app.py file with another html.div components I got this error.

1

There are 1 best solutions below

0
On

Use dcc.Graph(figure=your_figure_name) instead

html.Div([
    dcc.Graph(figure=your_figure_name)
])

Look at https://dash.plotly.com/dash-core-components/graph for more details about its documentation