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: String
Name of plot element in the diagram (annotated by default formatter)
orientation: Orientation
Which direction the bar faces in the diagram
argument: f64
Position on the argument (input) axis – X if vertical, Y if horizontal
value: f64
Position 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: f64
Thickness of the bar
stroke: Stroke
Line width and color
fill: Color32
Fill color
Implementations
sourceimpl 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) -> 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 RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnwindSafe for Bar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more