pub struct Bar {
pub name: String,
pub orientation: Orientation,
pub argument: f64,
pub value: f64,
pub base_offset: Option<f64>,
pub bar_width: f64,
pub stroke: Stroke,
pub fill: Color32,
}Expand description
One bar in a BarChart. Potentially floating, allowing stacked bar charts.
Width can be changed to allow variable-width histograms.
Fields§
§name: StringName of plot element in the diagram (annotated by default formatter)
orientation: OrientationWhich direction the bar faces in the diagram
argument: f64Position on the argument (input) axis – X if vertical, Y if horizontal
value: f64Position on the value (output) axis – Y if vertical, X if horizontal
base_offset: Option<f64>For stacked bars, this denotes where the bar starts. None if base axis
bar_width: f64Thickness of the bar
stroke: StrokeLine width and color
fill: Color32Fill color
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn new(argument: f64, height: f64) -> Bar
pub fn new(argument: f64, height: f64) -> Bar
Create a bar. Its orientation is set by its BarChart parent.
argument: Position on the argument axis (X if vertical, Y if horizontal).value: Height of the bar (if vertical).
By default the bar is vertical and its base is at zero.
Sourcepub fn base_offset(self, offset: f64) -> Bar
pub fn base_offset(self, offset: f64) -> Bar
Offset the base of the bar. This offset is on the Y axis for a vertical bar and on the X axis for a horizontal bar.
Sourcepub fn horizontal(self) -> Bar
pub fn horizontal(self) -> Bar
Set orientation of the element as horizontal. Argument axis is Y.
Trait Implementations§
impl StructuralPartialEq for Bar
Auto Trait Implementations§
impl Freeze for Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnwindSafe for Bar
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more