pub struct Gauge<'a> { /* private fields */ }Expand description
Gauge showing a value inside [min, max].
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{Gauge};
let chart = Gauge::new(0.62);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl<'a> Gauge<'a>
impl<'a> Gauge<'a>
Sourcepub fn bands(self, bands: impl IntoIterator<Item = (f64, Color)>) -> Self
pub fn bands(self, bands: impl IntoIterator<Item = (f64, Color)>) -> Self
Threshold bands: each (upper_bound, color) covers up to that value.
Sourcepub fn orientation(self, v: GaugeOrientation) -> Self
pub fn orientation(self, v: GaugeOrientation) -> Self
Horizontal or vertical.
Sourcepub fn style(self, v: GaugeStyle) -> Self
pub fn style(self, v: GaugeStyle) -> Self
Gauge form.
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).
Sourcepub fn marker(self, v: Marker) -> Self
pub fn marker(self, v: Marker) -> Self
Glyph family used for dot drawing (default Marker::Braille).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Gauge<'a>
impl<'a> RefUnwindSafe for Gauge<'a>
impl<'a> Send for Gauge<'a>
impl<'a> Sync for Gauge<'a>
impl<'a> Unpin for Gauge<'a>
impl<'a> UnsafeUnpin for Gauge<'a>
impl<'a> UnwindSafe for Gauge<'a>
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