pub struct FillBetweenArtist {
pub x: Series,
pub y1: Series,
pub y2: Series,
pub color: Color,
pub label: Option<String>,
pub alpha: f64,
}Expand description
A filled region between two y-series that share a common x-series.
The renderer draws a closed polygon connecting (x, y1) forward and
(x, y2) backward, then fills it with the configured color and opacity.
This is commonly used for confidence bands, area charts, and shaded
difference regions.
Fields§
§x: SeriesX-coordinates shared by both y-series.
y1: SeriesY-coordinates of the first boundary curve.
y2: SeriesY-coordinates of the second boundary curve.
color: ColorFill color of the shaded region.
label: Option<String>Optional legend label. When Some, the fill region appears in the legend.
alpha: f64Opacity from 0.0 (fully transparent) to 1.0 (fully opaque).
Implementations§
Source§impl FillBetweenArtist
impl FillBetweenArtist
Sourcepub fn data_bounds(&self) -> (f64, f64, f64, f64)
pub fn data_bounds(&self) -> (f64, f64, f64, f64)
Computes the data-space bounding box (xmin, xmax, ymin, ymax).
The x-bounds come from the shared x series. The y-bounds are the
union of y1 and y2 (i.e. the overall min and max across both
boundary curves). Falls back to (0.0, 1.0) on any axis that has
no finite values.
Source§impl FillBetweenArtist
impl FillBetweenArtist
Sourcepub fn label(&mut self, label: &str) -> &mut Self
pub fn label(&mut self, label: &str) -> &mut Self
Sets the legend label.
When a legend is displayed on the figure, this label will appear next to the color swatch for this fill region. Passing a new value overwrites any previously set label.
§Arguments
label- A string slice that will be stored as the legend entry.
§Examples
artist.label("Confidence interval");Sourcepub fn alpha(&mut self, alpha: f64) -> &mut Self
pub fn alpha(&mut self, alpha: f64) -> &mut Self
Sets the opacity (0.0 = fully transparent, 1.0 = fully opaque).
The value is clamped to the [0.0, 1.0] range. The default opacity
is 1.0. Lower values are useful for layering multiple fill regions
so that underlying data remains visible.
§Arguments
alpha- The desired opacity level.
§Examples
artist.alpha(0.3); // 30% opaque, letting background show throughTrait Implementations§
Source§impl Clone for FillBetweenArtist
impl Clone for FillBetweenArtist
Source§fn clone(&self) -> FillBetweenArtist
fn clone(&self) -> FillBetweenArtist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more