Python Plotly-Dash 从清单中删除 "inline",因此项目在单独的行中
Python Plotly-Dash remove "inline" from checklist so items are on separate lines
我正在使用 Plotly 的 Dash 库创建清单,我希望每个项目都在其自己的行上,但我不知道如何做。请注意下图中 "Delta P (PSI)" 和 "Horsepower" 如何在同一行上,这是我不想要的。
有什么想法吗?这是我的代码:
import dash
import dash_html_components as html
import dash_core_components as dcc
# Items to chart (checklist), based on unit type
html.Label('Items to Chart'),
dcc.Checklist(
options = [
{'label': 'Delta P (PSI)', 'value': 'dtp'},
{'label': 'Horsepower', 'value': 'hpe'},
{'label': 'Hydraulic temp (C)', 'value': 'ht_egas'},
],
# What to use for className???
className="checkbox or something..."
),
我想通了:
labelStyle = dict(display='block') # not 'inline'
https://dash.plot.ly/dash-core-components/checklist
import dash
import dash_html_components as html
import dash_core_components as dcc
# Items to chart (checklist), based on unit type
html.Label('Items to Chart'),
dcc.Checklist(
options = [
{'label': 'Delta P (PSI)', 'value': 'dtp'},
{'label': 'Horsepower', 'value': 'hpe'},
{'label': 'Hydraulic temp (C)', 'value': 'ht_egas'},
],
labelStyle = dict(display='block')
),
我正在使用 Plotly 的 Dash 库创建清单,我希望每个项目都在其自己的行上,但我不知道如何做。请注意下图中 "Delta P (PSI)" 和 "Horsepower" 如何在同一行上,这是我不想要的。
有什么想法吗?这是我的代码:
import dash
import dash_html_components as html
import dash_core_components as dcc
# Items to chart (checklist), based on unit type
html.Label('Items to Chart'),
dcc.Checklist(
options = [
{'label': 'Delta P (PSI)', 'value': 'dtp'},
{'label': 'Horsepower', 'value': 'hpe'},
{'label': 'Hydraulic temp (C)', 'value': 'ht_egas'},
],
# What to use for className???
className="checkbox or something..."
),
我想通了:
labelStyle = dict(display='block') # not 'inline'
https://dash.plot.ly/dash-core-components/checklist
import dash
import dash_html_components as html
import dash_core_components as dcc
# Items to chart (checklist), based on unit type
html.Label('Items to Chart'),
dcc.Checklist(
options = [
{'label': 'Delta P (PSI)', 'value': 'dtp'},
{'label': 'Horsepower', 'value': 'hpe'},
{'label': 'Hydraulic temp (C)', 'value': 'ht_egas'},
],
labelStyle = dict(display='block')
),