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(Borders::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]
impl<'a> BarChart<'a>
pub fn data(self, data: &'a [(&'a str, u64)]) -> BarChart<'a>
[src]
pub fn data(self, data: &'a [(&'a str, u64)]) -> BarChart<'a>
pub fn block(self, block: Block<'a>) -> BarChart<'a>
[src]
pub fn block(self, block: Block<'a>) -> BarChart<'a>
pub fn max(self, max: u64) -> BarChart<'a>
[src]
pub fn max(self, max: u64) -> BarChart<'a>
pub fn bar_width(self, width: u16) -> BarChart<'a>
[src]
pub fn bar_width(self, width: u16) -> BarChart<'a>
pub fn bar_gap(self, gap: u16) -> BarChart<'a>
[src]
pub fn bar_gap(self, gap: u16) -> BarChart<'a>
pub fn value_style(self, style: Style) -> BarChart<'a>
[src]
pub fn value_style(self, style: Style) -> BarChart<'a>
pub fn label_style(self, style: Style) -> BarChart<'a>
[src]
pub fn label_style(self, style: Style) -> BarChart<'a>
pub fn style(self, style: Style) -> BarChart<'a>
[src]
pub fn style(self, style: Style) -> BarChart<'a>
Trait Implementations
impl<'a> Default for BarChart<'a>
[src]
impl<'a> Default for BarChart<'a>
impl<'a> Widget for BarChart<'a>
[src]
impl<'a> Widget for BarChart<'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.