pub struct Bar<T> { /* private fields */ }Implementations§
Source§impl<T> Bar<T>
impl<T> Bar<T>
pub fn new() -> Self
Sourcepub fn data<I>(self, data: I) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn data<I>(self, data: I) -> Selfwhere
I: IntoIterator<Item = T>,
Set the data of the Bar.
Sourcepub fn alignment(self, alignment: BarAlignment) -> Self
pub fn alignment(self, alignment: BarAlignment) -> Self
Set the alignment of the Bar.
Default is BarAlignment::Bottom.
Sourcepub fn cross<F>(self, cross: F) -> Self
pub fn cross<F>(self, cross: F) -> Self
Set the cross-axis position of each bar (in pixels).
For vertical alignments this is the X coordinate; for horizontal alignments this is the Y coordinate.
Sourcepub fn band_width(self, band_width: f32) -> Self
pub fn band_width(self, band_width: f32) -> Self
Set the band width of the Bar (the bar thickness along the cross axis).
Sourcepub fn base<F>(self, base: F) -> Self
pub fn base<F>(self, base: F) -> Self
Set the baseline position of each bar (in pixels along the value axis).
Sourcepub fn value<F>(self, value: F) -> Self
pub fn value<F>(self, value: F) -> Self
Set the value-end position of each bar (in pixels along the value axis).
Sourcepub fn fill<F, B>(self, fill: F) -> Self
pub fn fill<F, B>(self, fill: F) -> Self
Set the fill of each bar.
The closure receives the datum, the bar’s painted frame (Bounds<f32>)
in raw pixel coordinates relative to the plot bounds origin, and the
bar’s BarAlignment (so callers can branch on orientation, e.g. flip
a gradient angle). Callers wishing to derive normalized or chart-relative
coordinates from this frame should do so themselves.
Accepts any type convertible to Background, including solid colors and
fully-specified [gpui::linear_gradient] values. The background is used
verbatim — the gradient angle is not adjusted for bar orientation.
Sourcepub fn corner_radii(self, corner_radii: impl Into<Corners<Pixels>>) -> Self
pub fn corner_radii(self, corner_radii: impl Into<Corners<Pixels>>) -> Self
Set the corner radii applied to every bar rectangle.
Use Corners::all for uniform rounding, or construct Corners manually to
round only specific corners (e.g. just the tip end of each bar).
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Bar<T>
impl<T> !Send for Bar<T>
impl<T> !Sync for Bar<T>
impl<T> !UnwindSafe for Bar<T>
impl<T> Freeze for Bar<T>
impl<T> Unpin for Bar<T>where
T: Unpin,
impl<T> UnsafeUnpin for Bar<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().