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(Borders::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]
impl<'a> Sparkline<'a>
pub fn block(self, block: Block<'a>) -> Sparkline<'a>
[src]
pub fn block(self, block: Block<'a>) -> Sparkline<'a>
pub fn style(self, style: Style) -> Sparkline<'a>
[src]
pub fn style(self, style: Style) -> Sparkline<'a>
pub fn data(self, data: &'a [u64]) -> Sparkline<'a>
[src]
pub fn data(self, data: &'a [u64]) -> Sparkline<'a>
pub fn max(self, max: u64) -> Sparkline<'a>
[src]
pub fn max(self, max: u64) -> Sparkline<'a>
Trait Implementations
impl<'a> Default for Sparkline<'a>
[src]
impl<'a> Default for Sparkline<'a>
impl<'a> Widget for Sparkline<'a>
[src]
impl<'a> Widget for Sparkline<'a>
fn draw(&mut self, area: Rect, buf: &mut Buffer)
[src]
fn draw(&mut 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)
[src]
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>(&mut self, f: &mut Frame<B>, area: Rect) where
Self: Sized,
B: Backend,
[src]
fn render<B>(&mut self, f: &mut Frame<B>, area: Rect) where
Self: Sized,
B: Backend,
Helper method that can be chained with a widget's builder methods to render it.