Struct tui::widgets::BarChart
[−]
[src]
pub struct BarChart<'a> { /* fields omitted */ }
Display multiple bars in a single widgets
Examples
BarChart::default() .block(Block::default().title("BarChart").borders(border::ALL)) .bar_width(3) .bar_gap(1) .style(Style::default().fg(Color::Yellow).bg(Color::Red)) .value_style(Style::default().fg(Color::Red).modifier(Modifier::Bold)) .label_style(Style::default().fg(Color::White)) .data(&[("B0", 0), ("B1", 2), ("B2", 4), ("B3", 3)]) .max(4);
Methods
impl<'a> BarChart<'a>
[src]
fn data(&'a mut self, data: &'a [(&'a str, u64)]) -> &mut BarChart<'a>
fn block(&'a mut self, block: Block<'a>) -> &mut BarChart<'a>
fn max(&'a mut self, max: u64) -> &mut BarChart<'a>
fn bar_width(&'a mut self, width: u16) -> &mut BarChart<'a>
fn bar_gap(&'a mut self, gap: u16) -> &mut BarChart<'a>
fn value_style(&'a mut self, style: Style) -> &mut BarChart<'a>
fn label_style(&'a mut self, style: Style) -> &mut BarChart<'a>
fn style(&'a mut self, style: Style) -> &mut BarChart<'a>
Trait Implementations
impl<'a> Default for BarChart<'a>
[src]
impl<'a> Widget for BarChart<'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.