pub struct Bar {
pub label: String,
pub value: f64,
pub style: Option<String>,
pub text: Option<String>,
pub value_style: Option<String>,
pub label_style: Option<String>,
}Expand description
One bar of a BarChart.
Fields§
§label: StringWritten before the bar (under it, when vertical).
value: f64The bar’s length on the chart’s scale.
style: Option<String>A theme key or style definition for this bar, instead of
chart.bar (chart.negative below zero).
text: Option<String>Written instead of the value, such as 76° or 8.5M (ratatui’s
text_value).
value_style: Option<String>A theme key or style definition for this bar’s value, over the chart’s.
label_style: Option<String>A theme key or style definition for this bar’s label, over the chart’s.
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn style(self, style: impl Into<String>) -> Self
pub fn style(self, style: impl Into<String>) -> Self
This bar’s style: a theme key or a definition.
Sourcepub fn text(self, text: impl Into<String>) -> Self
pub fn text(self, text: impl Into<String>) -> Self
Write text instead of the value (ratatui’s text_value). The
value still sets the bar’s length.
Sourcepub fn value_style(self, style: impl Into<String>) -> Self
pub fn value_style(self, style: impl Into<String>) -> Self
The value’s style, over the chart’s
value_style.
Sourcepub fn label_style(self, style: impl Into<String>) -> Self
pub fn label_style(self, style: impl Into<String>) -> Self
The label’s style, over the chart’s
label_style.
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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more