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]

Trait Implementations

impl<'a> Default for BarChart<'a>
[src]

Returns the "default value" for a type. Read more

impl<'a> Widget for BarChart<'a>
[src]

Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget. Read more

Helper method to quickly set the background of all cells inside the specified area.

Helper method that can be chained with a widget's builder methods to render it.