fix to show the title with more than one subplot

This commit is contained in:
Felix Meier 2021-10-23 18:08:43 +02:00
parent 02007b5e5d
commit 848d2d8785

View File

@ -432,8 +432,7 @@ def generate_candlestick_graph(pair: str, data: pd.DataFrame, trades: pd.DataFra
fig['layout']['yaxis1'].update(title='Price') fig['layout']['yaxis1'].update(title='Price')
fig['layout']['yaxis3'].update(title='Volume') fig['layout']['yaxis3'].update(title='Volume')
for i, name in enumerate(plot_config['subplots']): for i, name in enumerate(plot_config['subplots']):
fig['layout'][f'yaxis{5 + i }'].update(title=name) fig['layout'][f'yaxis{5 + i*2 }'].update(title=name)
# ToDo: if more then one subplot is used, the title is not shown
fig['layout']['xaxis']['rangeslider'].update(visible=False) fig['layout']['xaxis']['rangeslider'].update(visible=False)
fig.update_layout(modebar_add=["v1hovermode", "toggleSpikeLines"]) fig.update_layout(modebar_add=["v1hovermode", "toggleSpikeLines"])