pub struct LollipopChart { /* private fields */ }Expand description
Lollipop / dumbbell chart widget.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{LollipopChart, LollipopItem};
let chart = LollipopChart::new([LollipopItem::new("a", 3.0), LollipopItem::new("b", 5.0).from(1.0)]);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl LollipopChart
impl LollipopChart
Sourcepub fn new(items: impl IntoIterator<Item = LollipopItem>) -> Self
pub fn new(items: impl IntoIterator<Item = LollipopItem>) -> Self
Create a chart.
Sourcepub fn show_values(self, v: bool) -> Self
pub fn show_values(self, v: bool) -> Self
Print the value after each dot (default on).
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).
Trait Implementations§
Source§impl Clone for LollipopChart
impl Clone for LollipopChart
Source§impl Debug for LollipopChart
impl Debug for LollipopChart
Source§impl Widget for &LollipopChart
impl Widget for &LollipopChart
Auto Trait Implementations§
impl Freeze for LollipopChart
impl RefUnwindSafe for LollipopChart
impl Send for LollipopChart
impl Sync for LollipopChart
impl Unpin for LollipopChart
impl UnsafeUnpin for LollipopChart
impl UnwindSafe for LollipopChart
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