I am using Dash to create a web app, and showing some plotly charts.
My callback has the following code:
for fig in [fig1, fig2, fig3]:
fig.update_layout(
margin=dict(r=20, l=20, b=20, t=50),
spikedistance=-1,
hovermode='x unified',
plot_bgcolor='rgb(255,255,255)',
legend=dict(yanchor='top', y=0.95, xanchor='left', x=0.05, bordercolor='lightgray', borderwidth=1),
)
fig.update_traces(hovertemplate=None)
fig.update_xaxes(title=None,
spikemode='across', spikedash='solid', spikecolor='black', spikethickness=1)
fig.update_yaxes(gridcolor='lightgray', showline=True, title=None,
zeroline=True, zerolinecolor='lightgray')
return fig1, fig2, fig3
I don't like the plotly
default colors, and am trying to change them.
I tried adding the following to fig.update_layout
:
colorway = ['black','red','blue']
But it doesn't work to change the colours of the lines.
What am I doing wrong?