File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -523,6 +523,12 @@ def __eq__(self, other):
523
523
colors = colors and cycle (_as_list (colors )) or (
524
524
cycle ([next (ohlc_colors )]) if is_overlay else colorgen ())
525
525
legend_label = LegendStr (value .name )
526
+
527
+ indicator_max = value .df .max (axis = 'columns' )
528
+ indicator_min = value .df .min (axis = 'columns' )
529
+ source .add (indicator_max , f'indicator_{ j } _range_max' )
530
+ source .add (indicator_min ,f'indicator_{ j } _range_min' )
531
+
526
532
for j , arr in enumerate (value , 1 ):
527
533
color = next (colors )
528
534
source_name = f'{ legend_label } _{ i } _{ j } '
@@ -609,6 +615,12 @@ def __eq__(self, other):
609
615
source = source )
610
616
if plot_volume :
611
617
custom_js_args .update (volume_range = fig_volume .y_range )
618
+
619
+ indicator_ranges = {}
620
+ for idx ,indicator in enumerate (indicator_figs ):
621
+ indicator_range_key = f'indicator_{ idx } _range'
622
+ indicator_ranges .update ({indicator_range_key :indicator .y_range })
623
+ custom_js_args .update ({'indicator_ranges' :indicator_ranges })
612
624
613
625
fig_ohlc .x_range .js_on_change ('end' , CustomJS (args = custom_js_args ,
614
626
code = _AUTOSCALE_JS_CALLBACK ))
You can’t perform that action at this time.
0 commit comments