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) -> Self
pub fn new(argument: f64, height: f64) -> Self
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) -> Self
pub fn base_offset(self, offset: f64) -> Self
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) -> Self
pub fn horizontal(self) -> Self
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)