Crate bar_graph

Crate bar_graph 

Source
Expand description

A Ratatui widget to render bold, colorful bar graphs. Part of the tui-widgets suite by Joshka.

Braille Rainbow Solid Plasma Quadrant Magma Octant Viridis

More examples

Braille Magma Braille Viridis Solid Inferno Solid Sinebow Quadrant Plasma Quadrant Sinebow Octant Inferno Octant Rainbow

Uses the Colorgrad crate for gradient coloring.

Crate badge Docs Badge Deps Badge License Badge Coverage Badge Discord Badge

GitHub Repository · API Docs · Examples · Changelog · Contributing

§Installation

cargo add ratatui tui-bar-graph

§Usage

Build a BarGraph with your data and render it in a widget area.

use tui_bar_graph::{BarGraph, BarStyle, ColorMode};

let data = vec![0.0, 0.1, 0.2, 0.3, 0.4, 0.5];
let bar_graph = BarGraph::new(data)
    .with_gradient(colorgrad::preset::turbo())
    .with_bar_style(BarStyle::Braille)
    .with_color_mode(ColorMode::VerticalGradient);
frame.render_widget(bar_graph, area);

§More widgets

For the full suite of widgets, see tui-widgets.

Structs§

BarGraph
A widget for displaying a bar graph.

Enums§

BarStyle
The style of bar to render.
ColorMode
The direction of the gradient coloring.