【发布时间】:2020-02-04 11:53:52
【问题描述】:
我正在使用 Potly Dashboard 构建仪表板。我使用的是深色引导主题,因此我不想要白色背景。
但是,我的地图现在看起来像这样:
生成它的代码如下所示:
trace_map = html.Div(
[
dcc.Graph(
id = "map",
figure = go.Figure(
data=go.Choropleth(
locations=code, # Spatial coordinates
z = df.groupby(['month']).sum()['Sales'].astype(int),
locationmode = 'USA-states',
colorscale = 'Reds',
colorbar_title = "USD",
), layout = go.Layout(title = 'The Cities Sold the Most Product',
font = {"size": 9, "color":"White"},
titlefont = {"size": 15, "color":"White"},
geo_scope='usa',
margin={"r":0,"t":40,"l":0,"b":0},
paper_bgcolor='#4E5D6C',
plot_bgcolor='#4E5D6C',
)
)
)
]
)
我尝试过paper_bgcolor 和plot_bgcolor,但无法成功。
【问题讨论】:
标签: python dictionary plotly