Struct tui::widgets::Sparkline
[−]
[src]
pub struct Sparkline<'a> { /* fields omitted */ }
Widget to render a sparkline over one or more lines.
Examples
Sparkline::default() .block(Block::default().title("Sparkline").borders(border::ALL)) .data(&[0, 2, 3, 4, 1, 4, 10]) .max(5) .style(Style::default().fg(Color::Red).bg(Color::White));
Methods
impl<'a> Sparkline<'a>
[src]
fn block(&mut self, block: Block<'a>) -> &mut Sparkline<'a>
fn style(&mut self, style: Style) -> &mut Sparkline<'a>
fn data(&mut self, data: &'a [u64]) -> &mut Sparkline<'a>
fn max(&mut self, max: u64) -> &mut Sparkline<'a>
Trait Implementations
impl<'a> Default for Sparkline<'a>
[src]
impl<'a> Widget for Sparkline<'a>
[src]
fn draw(&self, area: &Rect, buf: &mut Buffer)
Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget. Read more
fn background(&self, area: &Rect, buf: &mut Buffer, color: Color)
Helper method to quickly set the background of all cells inside the specified area.
fn render<B>(&self, t: &mut Terminal<B>, area: &Rect) where
Self: Sized,
B: Backend,
Self: Sized,
B: Backend,
Helper method that can be chained with a widget's builder methods to render it.