在Dash UI python上渲染PlotlyDisplay对象

问题描述 投票:0回答:1

我想在我的Dash UI上渲染图形。我最初使用Jupyter Notebook上的plotly创建了图表。

我想要做的是在我的Dash UI上渲染相同的图形。我正在尝试的代码是:

 html.Div([
            new_data.iplot(subplots=True, subplot_titles=True, legend=False)
        ]),

我收到一个错误说明:

TypeError: Object of type 'PlotlyDisplay' is not JSON serializable

无论如何我能做到吗?我是Dash的新手,所以我能得到的任何帮助都会很棒!

python plotly plotly-dash
1个回答
0
投票

你将不得不使用dcc.Graph( ... )而不是iplot( ... )。以下是文档中的示例:https://dash.plot.ly/getting-started#dash-app-layout

© www.soinside.com 2019 - 2024. All rights reserved.