pub struct Funnel<'a> { /* private fields */ }Expand description
A conversion funnel.
§Examples
use tui_piechart::{Funnel, FunnelStage};
let funnel = Funnel::new(vec![
FunnelStage::new("Visits", 10_000.0),
FunnelStage::new("Sign-ups", 2_400.0),
FunnelStage::new("Paid", 380.0),
]);Implementations§
Source§impl<'a> Funnel<'a>
impl<'a> Funnel<'a>
Sourcepub fn new(stages: Vec<FunnelStage<'a>>) -> Self
pub fn new(stages: Vec<FunnelStage<'a>>) -> Self
Creates a funnel from stages, widest first.
Sourcepub const fn style(self, style: FunnelStyle) -> Self
pub const fn style(self, style: FunnelStyle) -> Self
Chooses bars or a trapezoid.
Sourcepub const fn show_values(self, show: bool) -> Self
pub const fn show_values(self, show: bool) -> Self
Shows or hides the value / conversion column on the right.
Sourcepub const fn base_style(self, style: Style) -> Self
pub const fn base_style(self, style: Style) -> Self
Base style of the whole area.
Sourcepub fn conversions(&self) -> Vec<f64>
pub fn conversions(&self) -> Vec<f64>
Share of each stage relative to the previous one (the first is 100).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Funnel<'a>
impl<'a> RefUnwindSafe for Funnel<'a>
impl<'a> Send for Funnel<'a>
impl<'a> Sync for Funnel<'a>
impl<'a> Unpin for Funnel<'a>
impl<'a> UnsafeUnpin for Funnel<'a>
impl<'a> UnwindSafe for Funnel<'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