pub struct Axis {
pub id: AxisId,
pub label: Option<String>,
pub min: Option<f64>,
pub max: Option<f64>,
pub tick_count: usize,
pub grid_lines: bool,
pub style: AxisStyle,
pub position: AxisPosition,
pub orientation: AxisOrientation,
pub visible: bool,
pub custom_ticks: Option<Vec<(f64, String)>>,
}Expand description
Axis configuration.
Fields§
§id: AxisIdUnique identifier
label: Option<String>Axis label
min: Option<f64>Minimum value (None = auto)
max: Option<f64>Maximum value (None = auto)
tick_count: usizeNumber of tick marks
grid_lines: boolShow grid lines
style: AxisStyleVisual style
position: AxisPositionPosition on the chart
orientation: AxisOrientationOrientation
visible: boolWhether this axis is visible
custom_ticks: Option<Vec<(f64, String)>>Custom tick values (if provided, overrides auto ticks)
Implementations§
Source§impl Axis
impl Axis
Sourcepub fn x_secondary() -> Self
pub fn x_secondary() -> Self
Create a secondary X axis (top).
Sourcepub fn y_secondary() -> Self
pub fn y_secondary() -> Self
Create a secondary Y axis (right).
Sourcepub fn with_range(self, min: f64, max: f64) -> Self
pub fn with_range(self, min: f64, max: f64) -> Self
Set the min/max range.
Sourcepub fn with_ticks(self, count: usize) -> Self
pub fn with_ticks(self, count: usize) -> Self
Set tick count.
Sourcepub fn with_custom_ticks(self, ticks: Vec<(f64, String)>) -> Self
pub fn with_custom_ticks(self, ticks: Vec<(f64, String)>) -> Self
Set custom tick values.
Sourcepub fn with_position(self, position: AxisPosition) -> Self
pub fn with_position(self, position: AxisPosition) -> Self
Set the axis position.
Sourcepub fn with_visible(self, visible: bool) -> Self
pub fn with_visible(self, visible: bool) -> Self
Set visibility.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set the axis label.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnsafeUnpin for Axis
impl UnwindSafe 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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