pub struct Pie<'a> { /* private fields */ }Expand description
A PieChart that reports hover / click regions and supports hiding
slices (see Interaction).
§Example
use ratatui::{buffer::Buffer, layout::Rect, style::Color};
use tui_chart::{HitMap, Pie, PieChart, PieSlice};
let chart = PieChart::new(vec![
PieSlice::new("Rust", 60.0, Color::Red),
PieSlice::new("Go", 40.0, Color::Blue),
]);
let area = Rect::new(0, 0, 60, 20);
let mut buf = Buffer::empty(area);
let hits = HitMap::capture(Pie::new(chart).hidden([1]), area, &mut buf);
assert!(!hits.is_empty());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Pie<'a>
impl<'a> Freeze for Pie<'a>
impl<'a> RefUnwindSafe for Pie<'a>
impl<'a> Send for Pie<'a>
impl<'a> Sync for Pie<'a>
impl<'a> Unpin for Pie<'a>
impl<'a> UnsafeUnpin for Pie<'a>
impl<'a> UnwindSafe for Pie<'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