Skip to content

Commit bf03b63

Browse files
authored
Auto-scale Y-axis for indicators when zooming kernc#356
1 parent 6b1c436 commit bf03b63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backtesting/_plotting.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ def __eq__(self, other):
523523
colors = colors and cycle(_as_list(colors)) or (
524524
cycle([next(ohlc_colors)]) if is_overlay else colorgen())
525525
legend_label = LegendStr(value.name)
526-
indicator_max = value.df.max(axis = 'columns')
527-
indicator_min = value.df.min(axis = 'columns')
526+
indicator_max = value.df.max(axis='columns')
527+
indicator_min = value.df.min(axis='columns')
528528
source.add(indicator_max, f'indicator_{i}_range_max')
529529
source.add(indicator_min, f'indicator_{i}_range_min')
530530
for j, arr in enumerate(value, 1):
@@ -612,7 +612,7 @@ def __eq__(self, other):
612612
custom_js_args = dict(ohlc_range=fig_ohlc.y_range,
613613
source=source)
614614
if plot_volume:
615-
custom_js_args.update(volume_range=fig_volume.y_range)
615+
custom_js_args.update(volume_range=fig_volume.y_range)
616616
indicator_ranges = {}
617617
for idx, indicator in enumerate(indicator_figs):
618618
indicator_range_key = f'indicator_{idx}_range'

0 commit comments

Comments
 (0)