[英]How to remove whitespace between dash dbc items?
我已經在儀表板上工作了一段時間,並且無法刪除一個 dbc.Row 元素(包含兩列)和下一個 dcc.markdown 元素之間的一大塊空白。 如果你看下面的圖片(縮小比例看起來有點滑稽),你會看到我似乎無法刪除的巨大空白。
我已經嘗試了各種方法來擺脫它,包括以下屬性的組合style={'margin-bottom': '1em'}, className="h-5", no_gutters=True
但似乎沒有任何效果. 是否有可能,Dash 正在應用某種我不知道的分頁符?
我的代碼如下所示:
dbc.Row([dbc.Col(dcc.Graph(id='table1', figure=
go.Figure(data=[go.Table(header=dict(values=['Accumulated Performance','(gross, in %)']),
cells=dict(values=[a, b]))],
layout=go.Layout(margin={'t': 25, 'b': 5, 'l': 10, 'r': 25}
)))
),
dbc.Col(dcc.Graph(id='table2', figure=
go.Figure(data=[go.Table(header=dict(values=['Selected Risk Metrics', '']),
cells=dict(values=[['Sharpe Ratio 1-y','Volatility 1-y','Information Ratio 1-y',
'Max 1-m drawdown (since inception)'],
['Value', 'Value', 'Value', 'Value']]))],
layout=go.Layout(margin={'t': 25, 'b': 5, 'l': 10, 'r': 25},
)))
)
], style={'margin-bottom': '1em'}, className="h-5", no_gutters=True),
dcc.Markdown('''
#### Investment Philosophy
Include some text describing my investment philosophy.
'''),
dcc.Graph(id='indexed_return_graph')
我需要為代碼style={'height': '175px'}為兩列中的每一列添加一個樣式參數。
dbc.Row([
dbc.Col(dcc.Graph(id='table1', figure=
go.Figure(data=[go.Table(header=dict(values=['Accumulated Performance','(gross, in %)']),
cells=dict(values=[a, b]))],
layout=go.Layout(margin={'t': 5, 'b': 0, 'l': 10, 'r': 0, 'pad':10}
)), style={'height': '175px'})),
dbc.Col(dcc.Graph(id='table2', figure=
go.Figure(data=[go.Table(header=dict(values=['Selected Risk Metrics', '']),
cells=dict(values=[['Sharpe Ratio 1-y','Volatility 1-y','Information Ratio 1-y',
'Max 1-m drawdown (since inception)'],
['Value', 'Value', 'Value', 'Value']]))],
layout=go.Layout(margin={'t': 5, 'b': 0, 'l': 10, 'r': 0, 'pad':10}
)), style={'height': '175px'}))
])
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.