python - 如何使用 bootstrap 设计我的 Plotly Dash 应用程序?

标签 python css plotly plotly-dash

这是我的代码。 我正在尝试将两个图表彼此对齐。

最简单的方法是什么?

    ########### Display the chart
    app = dash.Dash()
    server = app.server

    app.layout = html.Div(style={'backgroundColor': '#000000'},children=[
        html.H1('Indicator'),
        dcc.Graph(
            id='Teste1',
            figure=client_relation
        ),

        dcc.Graph(
            id='Test2',
            figure=beer_fig
        ),


        ]
    )

    if __name__ == '__main__':
        app.run_server()

最佳答案

我正在使用这段代码。将样式添加为“inline-block”到您的代码中,以使两个图表都在一条直线上。 将两个图表包含在一个 html block 中。

dcc.Graph(id='my_graph1',style={'width':1000, 'display': 'inline-block'},
        figure=go.Figure(
            data =[trace1, trace2],
            layout = go.Layout(
            title=' nifty',

            xaxis=dict(
                #domain=[0.03, 0.9]
                title='Date',
            ),
            yaxis=dict(
                title='Nifty',
                side='right',
            ), 
        ),

dcc.Graph(id='Pie',style={'width': 500, 'display': 'inline-block'},
),

html.Hr(),

希望您能采纳并修改。

关于python - 如何使用 bootstrap 设计我的 Plotly Dash 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57640924/

相关文章:

css - 我找不到我的 CSS 链接颜色的来源。有什么线索吗?

JavaScript - 创建一些可用于为表格行提供替代样式的 CSS 类

python - 这个例子 Plotly 散点图不起作用,你能告诉我为什么吗?

python - 设置绘图热图范围

python - 本地 CSS 文件从 plotly dash 应用程序中掉落

python - 为什么最小(非贪婪)匹配会受到字符串结尾字符 '$' 的影响?

Python,基本函数混淆

jquery - 使用来自 css-tricks.com 的 jQuery 切换文本

python - Perlin噪音问题: clearly visible lines in result

python - dlib 安装 AWS EC2 实例 Ubuntu 16.04 出错