File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,7 @@ pub struct Line {
427
427
pub ( super ) highlight : bool ,
428
428
pub ( super ) allow_hover : bool ,
429
429
pub ( super ) fill : Option < f32 > ,
430
+ pub ( super ) fill_alpha : f32 ,
430
431
pub ( super ) style : LineStyle ,
431
432
id : Option < Id > ,
432
433
}
@@ -440,6 +441,7 @@ impl Line {
440
441
highlight : false ,
441
442
allow_hover : true ,
442
443
fill : None ,
444
+ fill_alpha : DEFAULT_FILL_ALPHA ,
443
445
style : LineStyle :: Solid ,
444
446
id : None ,
445
447
}
@@ -487,6 +489,13 @@ impl Line {
487
489
self
488
490
}
489
491
492
+ /// Set the fill area's alpha channel. Default is `0.05`.
493
+ #[ inline]
494
+ pub fn fill_alpha ( mut self , alpha : impl Into < f32 > ) -> Self {
495
+ self . fill_alpha = alpha. into ( ) ;
496
+ self
497
+ }
498
+
490
499
/// Set the line's style. Default is `LineStyle::Solid`.
491
500
#[ inline]
492
501
pub fn style ( mut self , style : LineStyle ) -> Self {
@@ -545,7 +554,7 @@ impl PlotItem for Line {
545
554
fill = None ;
546
555
}
547
556
if let Some ( y_reference) = fill {
548
- let mut fill_alpha = DEFAULT_FILL_ALPHA ;
557
+ let mut fill_alpha = self . fill_alpha ;
549
558
if * highlight {
550
559
fill_alpha = ( 2.0 * fill_alpha) . at_most ( 1.0 ) ;
551
560
}
You can’t perform that action at this time.
0 commit comments