pub struct BandOptions {
pub fill: Option<Rgba>,
pub fill_crossed: Option<Rgba>,
}Expand description
Colors of a band between two series.
§Examples
use ferrochart_core::chart::{BandOptions, SeriesData, SeriesOptions};
use ferrochart_core::data::ValueColumns;
use ferrochart_core::frame::SeriesKind;
use ferrochart_core::geom::Rgba;
use ferrochart_core::{Chart, ChartOptions};
let mut chart = Chart::new(ChartOptions::default());
let pane = chart.main_pane();
let a = chart.add_series(pane, SeriesKind::Line, SeriesOptions::default())?;
let b = chart.add_series(pane, SeriesKind::Line, SeriesOptions::default())?;
let line = |v: Vec<f64>| SeriesData::Value(ValueColumns { time: vec![0, 60_000, 120_000], value: v, color: None });
chart.set_data(a, line(vec![2.0, 3.0, 1.0]))?;
chart.set_data(b, line(vec![1.0, 1.0, 2.0]))?;
// Green where a is above b, red where it is below.
let band = chart.add_band(a, b, BandOptions {
fill: Some(Rgba::hex(0x0026_A69A).with_alpha(0x40)),
fill_crossed: Some(Rgba::hex(0x00EF_5350).with_alpha(0x40)),
})?;
assert!(chart.band_options(band).is_some());
chart.remove_band(band)?;Fields§
§fill: Option<Rgba>Fill where the upper series is at or above the lower one; None: the
upper series’ color at 15% opacity.
fill_crossed: Option<Rgba>Fill where the upper series is below the lower one; None: as fill.
Trait Implementations§
Source§impl Clone for BandOptions
impl Clone for BandOptions
impl Copy for BandOptions
Source§impl Debug for BandOptions
impl Debug for BandOptions
Source§impl Default for BandOptions
impl Default for BandOptions
Source§impl PartialEq for BandOptions
impl PartialEq for BandOptions
impl StructuralPartialEq for BandOptions
Auto Trait Implementations§
impl Forget for BandOptions
impl Freeze for BandOptions
impl Move for BandOptions
impl RefUnwindSafe for BandOptions
impl Send for BandOptions
impl Sync for BandOptions
impl Unpin for BandOptions
impl UnsafeUnpin for BandOptions
impl UnwindSafe for BandOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more