Skip to main content

FillBetweenArtist

Struct FillBetweenArtist 

Source
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: Series

X-coordinates shared by both y-series.

§y1: Series

Y-coordinates of the first boundary curve.

§y2: Series

Y-coordinates of the second boundary curve.

§color: Color

Fill color of the shaded region.

§label: Option<String>

Optional legend label. When Some, the fill region appears in the legend.

§alpha: f64

Opacity from 0.0 (fully transparent) to 1.0 (fully opaque).

Implementations§

Source§

impl FillBetweenArtist

Source

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

Source

pub fn color(&mut self, color: Color) -> &mut Self

Sets the fill color.

Applies the given Color to the entire shaded region between the two boundary curves. Any previously set color is replaced.

§Arguments
  • color - The Color to fill the region with.
§Examples
artist.color(Color::rgb(78, 121, 167));
Source

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");
Source

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 through

Trait Implementations§

Source§

impl Clone for FillBetweenArtist

Source§

fn clone(&self) -> FillBetweenArtist

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FillBetweenArtist

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.