[英]plotly dash display graph_objects pie chart inside html elemet
I am trying to display pie chart inside html div as below:我正在尝试在 html div 中显示饼图,如下所示:
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).
“object 是作为子项提供的,而不是组件、字符串或数字(或它们的列表)。 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.如果我尝试使用
.show()
在单独的文件中显示相同的图表,它可以工作,但是当我尝试在带有另一个html.div
组件的 app.py 文件中显示它时,我收到了这个错误。
Use dcc.Graph(figure=your_figure_name) instead改用 dcc.Graph(figure=your_figure_name)
html.Div([
dcc.Graph(figure=your_figure_name)
])
Look at https://dash.plotly.com/dash-core-components/graph for more details about its documentation查看https://dash.plotly.com/dash-core-components/graph了解有关其文档的更多详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.