@@ -549,14 +549,19 @@ def __eq__(self, other):
549
549
550
550
for i , value in enumerate (indicators ):
551
551
value = np .atleast_2d (value )
552
+ if _too_many_dims (value ):
553
+ continue
552
554
553
555
# Use .get()! A user might have assigned a Strategy.data-evolved
554
556
# _Array without Strategy.I()
555
- if not value ._opts .get ('plot' ) or _too_many_dims (value ):
557
+ is_overlay = value ._opts .get ('overlay' )
558
+ is_scatter = value ._opts .get ('scatter' )
559
+ is_muted = not value ._opts .get ('plot' )
560
+
561
+ # is overlay => show muted, hide legend item. non-overlay => don't show at all
562
+ if is_muted and not is_overlay :
556
563
continue
557
564
558
- is_overlay = value ._opts ['overlay' ]
559
- is_scatter = value ._opts ['scatter' ]
560
565
if is_overlay :
561
566
fig = fig_ohlc
562
567
else :
@@ -581,30 +586,31 @@ def __eq__(self, other):
581
586
arr = arr .astype (int )
582
587
source .add (arr , source_name )
583
588
tooltips .append (f'@{{{ source_name } }}{{0,0.0[0000]}}' )
589
+ kwargs = {}
590
+ if not is_muted :
591
+ kwargs ['legend_label' ] = legend_labels [j ]
584
592
if is_overlay :
585
593
ohlc_extreme_values [source_name ] = arr
586
594
if is_scatter :
587
- fig .circle (
595
+ r2 = fig .circle (
588
596
'index' , source_name , source = source ,
589
- legend_label = legend_labels [j ], color = color ,
590
- line_color = 'black' , fill_alpha = .8 ,
591
- radius = BAR_WIDTH / 2 * .9 )
597
+ color = color , line_color = 'black' , fill_alpha = .8 ,
598
+ radius = BAR_WIDTH / 2 * .9 , ** kwargs )
592
599
else :
593
- fig .line (
600
+ r2 = fig .line (
594
601
'index' , source_name , source = source ,
595
- legend_label = legend_labels [j ], line_color = color ,
596
- line_width = 1.3 )
602
+ line_color = color , line_width = 1.4 if is_muted else 1.5 , ** kwargs )
603
+ # r != r2
604
+ r2 .muted = is_muted
597
605
else :
598
606
if is_scatter :
599
607
r = fig .circle (
600
608
'index' , source_name , source = source ,
601
- legend_label = legend_labels [j ], color = color ,
602
- radius = BAR_WIDTH / 2 * .6 )
609
+ color = color , radius = BAR_WIDTH / 2 * .6 , ** kwargs )
603
610
else :
604
611
r = fig .line (
605
612
'index' , source_name , source = source ,
606
- legend_label = legend_labels [j ], line_color = color ,
607
- line_width = 1.3 )
613
+ line_color = color , line_width = 1.3 , ** kwargs )
608
614
# Add dashed centerline just because
609
615
mean = try_ (lambda : float (pd .Series (arr ).mean ()), default = np .nan )
610
616
if not np .isnan (mean ) and (abs (mean ) < .1 or
0 commit comments