pub struct BarChartStyle {
pub foreground: Color,
pub background: Color,
pub bar: Color,
pub value_foreground: Color,
pub label_foreground: Color,
}Expand description
Colors for a BarChartWidget.
A chart has no interaction states, so unlike the other style structs there is one color per role rather than one per role per state.
Fields§
§foreground: ColorDefault text color for anything not covered by the roles below.
background: ColorFill behind the whole chart.
bar: ColorThe bars themselves.
value_foreground: ColorThe value printed inside each bar, so it must contrast with bar.
label_foreground: ColorVertical bar labels and group labels. Ratatui’s horizontal renderer does
not apply its chart-level label style to ordinary bar labels; style those
labels directly on their Line or spans.
Implementations§
Source§impl BarChartStyle
impl BarChartStyle
Sourcepub const fn fallback() -> Self
pub const fn fallback() -> Self
A neutral style using plain ANSI colors, for painting without a
Theme. Prefer from_theme when one is available.
Sourcepub const fn from_theme(theme: &Theme) -> Self
pub const fn from_theme(theme: &Theme) -> Self
Derive chart colors from theme. Bars use the primary color, with the
value drawn in the primary foreground so it stays legible on top.
Trait Implementations§
Source§impl Clone for BarChartStyle
impl Clone for BarChartStyle
Source§fn clone(&self) -> BarChartStyle
fn clone(&self) -> BarChartStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BarChartStyle
Source§impl Debug for BarChartStyle
impl Debug for BarChartStyle
impl Eq for BarChartStyle
Source§impl PartialEq for BarChartStyle
impl PartialEq for BarChartStyle
impl StructuralPartialEq for BarChartStyle
Auto Trait Implementations§
impl Freeze for BarChartStyle
impl RefUnwindSafe for BarChartStyle
impl Send for BarChartStyle
impl Sync for BarChartStyle
impl Unpin for BarChartStyle
impl UnsafeUnpin for BarChartStyle
impl UnwindSafe for BarChartStyle
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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