0

我想在单独的行中使用破折号和绘图显示多项目符号图表和图标。我希望他们显示如下图所示的内容。我已经在一行上实现了多项目符号图表。由于域 x 和 y 的定位,我无法在此图标旁边放置另一个多项目符号图表。这是我到目前为止的代码。一旦我得到这个,我将添加一个下拉列表来显示此信息。

在此处输入图像描述

app = dash.Dash(__name__)
fig = go.Figure()

fig.add_trace(go.Indicator(
    mode = "number+gauge+delta", value = 180,
    delta = {'reference': 200},
    domain = {'x': [0.25, 1], 'y': [0.08, 0.25]},
    title = {'text': "SV 3"},
    gauge = {'shape': "bullet"}))

fig.add_trace(go.Indicator(
    mode = "number+gauge+delta", value = 35,
    delta = {'reference': 200},
    domain = {'x': [0.25, 1], 'y': [0.4, 0.6]},
    title = {'text': "SV 2"},
    gauge = {'shape': "bullet"}))

fig.add_trace(go.Indicator(
    mode = "number+gauge+delta", value = 220,
    delta = {'reference': 200},
    domain = {'x': [0.25, 1], 'y': [0.7, 0.9]},
    title = {'text' :"SV 1"},
    gauge= {'shape': "bullet"}))

fig.update_layout(height = 400 , margin = {'t':0, 'b':0, 'l':0})
fig.show()


app.run_server(debug=True, use_reloader=True)
4

1 回答 1

0

我建议您使用dash-bootstrap-components

layout = html.Div(
    [
        dbc.Row(
            dbc.Col
                (html.Div("A single, half-width column"), width=6)),
        dbc.Row(
            [
                dbc.Col(fig, width=3),
                dbc.Col(html.Div("Some space in the middle")),
                dbc.Col(html.Div("One of your other elements"), width=3),
            ]
        ),
    ]
)
于 2021-09-16T00:55:07.930 回答