pub struct RadialBar { /* private fields */ }Expand description
Concentric progress rings, outermost first, with an optional legend.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{RadialBar, RadialRing};
let chart = RadialBar::new([
RadialRing::new("Move", 420.0, 600.0),
RadialRing::new("Exercise", 25.0, 30.0),
]);
let area = Rect::new(0, 0, 50, 14);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl RadialBar
impl RadialBar
Sourcepub fn new(rings: impl IntoIterator<Item = RadialRing>) -> Self
pub fn new(rings: impl IntoIterator<Item = RadialRing>) -> Self
Create a chart from rings, outermost first.
Sourcepub fn sweep(self, v: RadialSweep) -> Self
pub fn sweep(self, v: RadialSweep) -> Self
270° or full sweep.
Sourcepub fn track(self, v: Color) -> Self
pub fn track(self, v: Color) -> Self
Color of the unfilled track (default: theme grid / dark gray).
Sourcepub fn base_style(self, style: Style) -> Self
pub fn base_style(self, style: Style) -> Self
Base style painted over the whole area (beats the theme).
Hide rings by index. They keep their slot and legend entry (dimmed),
so they can be toggled back, see Interaction.
Trait Implementations§
Source§impl Themed for RadialBar
Available on crate feature theme only.
impl Themed for RadialBar
Available on crate feature
theme only.Source§fn apply_theme(self, theme: &Theme) -> Self
fn apply_theme(self, theme: &Theme) -> Self
Return
self styled from theme. Explicit per-item colors set on the
widget should keep winning over the theme.Source§fn themed(self, provider: &impl ThemeProvider) -> Self
fn themed(self, provider: &impl ThemeProvider) -> Self
Apply the theme produced by any
ThemeProvider.Auto Trait Implementations§
impl Forget for RadialBar
impl Freeze for RadialBar
impl RefUnwindSafe for RadialBar
impl Send for RadialBar
impl Sync for RadialBar
impl Unpin for RadialBar
impl UnsafeUnpin for RadialBar
impl UnwindSafe for RadialBar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more