pub struct BarChart { /* private fields */ }
Expand description
BarChart widget for rendering arrays as vertical bars
Implementations§
Source§impl BarChart
impl BarChart
Sourcepub fn value_style(self, style: Style) -> Self
pub fn value_style(self, style: Style) -> Self
Set the style for values
Sourcepub fn label_style(self, style: Style) -> Self
pub fn label_style(self, style: Style) -> Self
Set the style for labels
Sourcepub fn max_height(self, height: u16) -> Self
pub fn max_height(self, height: u16) -> Self
Set the maximum height for bars
Sourcepub fn highlight_indices(self, indices: Vec<usize>) -> Self
pub fn highlight_indices(self, indices: Vec<usize>) -> Self
Set indices to highlight
Sourcepub fn highlight_style(self, style: Style) -> Self
pub fn highlight_style(self, style: Style) -> Self
Set style for highlighted bars
Sourcepub fn from_array_with_colors(array: &[i32], highlights: &[usize]) -> Self
pub fn from_array_with_colors(array: &[i32], highlights: &[usize]) -> Self
Convert array data to bar chart data with color mapping
Sourcepub fn from_array_compact(
array: &[i32],
highlights: &[usize],
terminal_width: u16,
) -> (Self, String)
pub fn from_array_compact( array: &[i32], highlights: &[usize], terminal_width: u16, ) -> (Self, String)
Create a compact visualization using blocks instead of numbers for very large arrays
Sourcepub fn from_array_with_viewport(
array: &[i32],
highlights: &[usize],
terminal_width: u16,
viewport_center: Option<usize>,
) -> (Self, String)
pub fn from_array_with_viewport( array: &[i32], highlights: &[usize], terminal_width: u16, viewport_center: Option<usize>, ) -> (Self, String)
Create a viewport view of large arrays
Sourcepub fn scale_for_terminal(
self,
terminal_width: u16,
terminal_height: u16,
) -> Self
pub fn scale_for_terminal( self, terminal_width: u16, terminal_height: u16, ) -> Self
Scale the chart for different terminal sizes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BarChart
impl RefUnwindSafe for BarChart
impl Send for BarChart
impl Sync for BarChart
impl Unpin for BarChart
impl UnwindSafe for BarChart
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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