[英]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.