#[repr(C)]pub struct ChartRegion {
pub x0: f32,
pub x1: f32,
pub y0: f32,
pub y1: f32,
pub color: Option<Rgb>,
pub label: String,
pub vertical: bool,
}Expand description
One rectangle in a Widget::RegionChart, spanning [x0, x1] horizontally and [y0, y1]
vertically in the chart’s domain. label is centered inside (empty = none); vertical rotates
it 90° for narrow columns. color overrides the auto-assigned palette slot.
Fields§
§x0: f32§x1: f32§y0: f32§y1: f32§color: Option<Rgb>§label: String§vertical: boolImplementations§
Source§impl ChartRegion
impl ChartRegion
Sourcepub fn new(
x0: f32,
x1: f32,
y0: f32,
y1: f32,
label: impl Into<String>,
) -> ChartRegion
pub fn new( x0: f32, x1: f32, y0: f32, y1: f32, label: impl Into<String>, ) -> ChartRegion
A region spanning [x0,x1] × [y0,y1] with a centered label (palette color, horizontal).
Sourcepub fn with_color(self, color: Rgb) -> ChartRegion
pub fn with_color(self, color: Rgb) -> ChartRegion
Override the fill color.
Sourcepub fn vertical(self) -> ChartRegion
pub fn vertical(self) -> ChartRegion
Render the label rotated 90° (for tall, narrow regions).
Trait Implementations§
Source§impl Clone for ChartRegion
impl Clone for ChartRegion
Source§fn clone(&self) -> ChartRegion
fn clone(&self) -> ChartRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChartRegion
impl Debug for ChartRegion
Source§impl<'de> Deserialize<'de> for ChartRegion
impl<'de> Deserialize<'de> for ChartRegion
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChartRegion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChartRegion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'ʄ> Facet<'ʄ> for ChartRegion
impl<'ʄ> Facet<'ʄ> for ChartRegion
Source§impl PartialEq for ChartRegion
impl PartialEq for ChartRegion
Source§impl Serialize for ChartRegion
impl Serialize for ChartRegion
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ChartRegion
Auto Trait Implementations§
impl Freeze for ChartRegion
impl RefUnwindSafe for ChartRegion
impl Send for ChartRegion
impl Sync for ChartRegion
impl Unpin for ChartRegion
impl UnsafeUnpin for ChartRegion
impl UnwindSafe for ChartRegion
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