pub struct Axis { /* private fields */ }Expand description
Configuration for a chart axis (title, bounds, ticks, grid, labels).
Implementations§
Source§impl Axis
impl Axis
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
Axis title (drawn at the top for y, at the bottom for x).
Sourcepub fn bounds(self, min: f64, max: f64) -> Self
pub fn bounds(self, min: f64, max: f64) -> Self
Fixed (min, max) bounds instead of auto-scaling.
Sourcepub fn label_style(self, style: Style) -> Self
pub fn label_style(self, style: Style) -> Self
Style of tick labels and the title.
Sourcepub fn grid_style(self, style: Style) -> Self
pub fn grid_style(self, style: Style) -> Self
Style of the grid lines.
Sourcepub fn grid_lines(self, v: GridStyle) -> Self
pub fn grid_lines(self, v: GridStyle) -> Self
Grid line look: dotted (default), dashed or solid.
Sourcepub fn labels<I, S>(self, labels: I) -> Self
pub fn labels<I, S>(self, labels: I) -> Self
Custom, evenly spaced tick labels (overrides numeric ticks).
Sourcepub fn formatter(
self,
f: impl Fn(f64) -> String + Send + Sync + 'static,
) -> Self
pub fn formatter( self, f: impl Fn(f64) -> String + Send + Sync + 'static, ) -> Self
Custom number formatter for tick labels. Accepts function pointers and (capturing) closures.
Sourcepub fn formatter_fn(self, f: Arc<dyn Fn(f64) -> String + Send + Sync>) -> Self
pub fn formatter_fn(self, f: Arc<dyn Fn(f64) -> String + Send + Sync>) -> Self
Alias of Axis::formatter taking an already shared formatter.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Axis
impl !UnwindSafe for Axis
impl Freeze for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnsafeUnpin for Axis
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