python-3.x - Python Plotly-Dash 从 list 中删除 "inline",以便项目位于不同的行上

标签 python-3.x bootstrap-4 plotly-dash

我正在使用 Plotly 的 Dash 库创建一个 list ,我希望每个项目都在自己的行上,但我不知道如何做。请注意下图中的“Delta P (PSI)”和“马力”如何位于同一行,这是我不想要的。

有什么想法吗?这是我的代码:

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..."
),

enter image description here

最佳答案

我明白了:

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')
),

enter image description here

关于python-3.x - Python Plotly-Dash 从 list 中删除 "inline",以便项目位于不同的行上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60472154/

相关文章:

python - 计时器对象返回参数Nº错误

Jquery mmenu 从 bootstrap 4 布局中退出

html - 如何将 container-fluid 内的内容与 bootstrap 4 上的容器对齐?

css - 如何根据容器调整表格的高度

python - 运行plotly dash代码时,在chrome浏览器中加载依赖项时出错

python - Scrapy 从 XPath 返回空数组

python - Numpy 一维数组 : Row or Column Matrix by Default?

python - Python 3 的图像库

python - 通过回调更新 Dash 数据表