Skip to content

Commit 44b2519

Browse files
authored
Reverted: Auto-scale Y-axis for Profit/Loss chart when zooming kernc#356
Reverted: Auto-scale Y-axis for Profit/Loss chart when zooming kernc#356
2 parents 18ecead + 95e03f8 commit 44b2519

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backtesting/_plotting.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ def __eq__(self, other):
588588
figs_above_ohlc.append(_plot_drawdown_section())
589589

590590
if plot_pl:
591-
figs_above_ohlc.append(_plot_pl_section())
591+
fig_pl = _plot_pl_section()
592+
figs_above_ohlc.append(fig_pl)
592593

593594
if plot_volume:
594595
fig_volume = _plot_volume_section()
@@ -611,6 +612,8 @@ def __eq__(self, other):
611612

612613
custom_js_args = dict(ohlc_range=fig_ohlc.y_range,
613614
source=source)
615+
if plot_pl:
616+
custom_js_args.update(pl_range=fig_pl.y_range)
614617
if plot_volume:
615618
custom_js_args.update(volume_range=fig_volume.y_range)
616619
indicator_ranges = {}

0 commit comments

Comments
 (0)