![](/img/trans.png)
[英]Setting dash-daq graph height in Python Dash Bootstrap Components
[英]Expand graph to the full size of the Dash bootstrap (dbc) column in python
我最近一直在使用 dash,遇到了一個問題。 我的側面圖沒有擴展到 dbc 列的完整大小,我不明白為什么。 最后,我希望折線圖堆疊在彼此之上,條形圖緊挨着它們。 如果有人有解決辦法,我將不勝感激。
content = html.Div(
[
dbc.Row(
[
dbc.Col(
[
dbc.Row([
html.P(id="Ticker-Chart-Headline", style={"textAlign": "center"}),
dcc.Graph(id="line-graph"),
]),
dbc.Row([
html.P(id="Indicator-Chart-Headline", style={"textAlign": "center"}),
dcc.Graph(id="Indicator-Graph")
])
], width={"size": 7},
className="bg-dark text-white"
),
dbc.Col(
[
html.P(id="Backtesting-Graph-Headline", style={"textAlign": "center"}),
dcc.Graph(id="Backtesting-Graph",responsive=True)
], width={"size": 5},
className="bg-dark text-white"
)
],
style={
"margin-top": "0px", "margin-left": "8px",
"margin-bottom": "8px"}),
]
)
app.layout = dbc.Container(
[
html.H1("Stock market trading Dashbaord", id="Headline",
style={"color": "white", "textAlign": "center", "font-weight": "bold"}),
dbc.Row(
[
dbc.Col(sidebar, width=2, className="text-white bg-primary font-italic"),
dbc.Col(content, width=10, className="text-white font-italic")
],
),
],
fluid=True
)`
要解決圖形未擴展到其容器的完整大小的問題,您可以嘗試將 dcc.Graph 組件的高度參數設置為固定值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.