pub struct Sparkline { /* private fields */ }
Expand description
A simple sparkline chart renderer
Implementations§
Source§impl Sparkline
impl Sparkline
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Create a new sparkline with specified dimensions
Sourcepub fn add_data_point(&mut self, value: f64)
pub fn add_data_point(&mut self, value: f64)
Add a data point to the sparkline
Sourcepub fn render_string(&self) -> String
pub fn render_string(&self) -> String
Render the sparkline as a string
Sourcepub fn render_with_labels(&self, title: &str) -> String
pub fn render_with_labels(&self, title: &str) -> String
Render with labels
Sourcepub fn set_height(&mut self, height: usize)
pub fn set_height(&mut self, height: usize)
Set height
Sourcepub fn render_widget(&self, area: Rect, buf: &mut Buffer)
pub fn render_widget(&self, area: Rect, buf: &mut Buffer)
Render the sparkline to a ratatui buffer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sparkline
impl RefUnwindSafe for Sparkline
impl Send for Sparkline
impl Sync for Sparkline
impl Unpin for Sparkline
impl UnwindSafe for Sparkline
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> 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