Plotly Dash: 在输出中显示变量值。

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

我试图使用COVID-19数据集,用plotly Dash做一个仪表盘,从这里可以得到。https:/github.comRamiKrispincoronavirus-csv。

现在,我想显示通过下拉菜单选择的国家的摘要。但是,我不知道如何只显示变量值。

我已经为总的摘要做了这样的处理。只用HTML进行汇总

html.Div([html.H1('Summary'),

                              html.Div([html.H2('Confirmed'), 
                                        html.H2(t_confirmed)
                                       ], style = {'width': '30%','display': 'inline-block', 'border':'2px solid black', 'text-align' : 'center', 'font-family': 'Century Gothic'}),
                              html.Div([html.H2('Recovered'), 
                                        html.H2(t_recovered)
                                       ], style = {'width': '30%','display': 'inline-block', 'border':'2px solid black', 'text-align' : 'center', 'font-family': 'Century Gothic'}),
                              html.Div([html.H2('Deaths'), 
                                        html.H2(t_deaths)
                                       ], style = {'width': '30%','display': 'inline-block', 'border':'2px solid black', 'text-align' : 'center', 'font-family': 'Century Gothic'}),

                             ], style = {'width': '50%','display': 'inline-block', 'vertical-align' : 'top', 'font-family' : 'Century Gothic'})

我想要的是,这些值应该根据选择的国家而改变。我有代码和函数,可以根据不同的国家返回这些值。但不知道如何显示它们。任何帮助将是感激的

python data-visualization dashboard plotly-dash
1个回答
0
投票

听起来你需要的是 仪表盘回调. 当你与你的组件进行交互时,这些功能允许你动态地改变它们的外观。向下滚动,看看 "多重输出 "部分--这可能与您正在尝试做的类似。希望能帮到你。

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