Skip to main content

AxisOption

Struct AxisOption 

Source
pub struct AxisOption {
Show 27 fields pub axis_type: AxisType, pub data: Vec<DataValue>, pub name: Option<String>, pub name_location: Option<String>, pub name_gap: Option<f64>, pub name_text_style: Option<LabelOption>, pub position: Option<Position>, pub show: bool, pub axis_label: Option<LabelOption>, pub axis_line: Option<AxisLineOption>, pub axis_tick: Option<AxisTickOption>, pub split_line: Option<SplitLineOption>, pub min: Option<f64>, pub max: Option<f64>, pub split_gap: Option<f64>, pub split_number: Option<usize>, pub interval: Option<f64>, pub min_interval: Option<f64>, pub max_interval: Option<f64>, pub log_base: Option<f64>, pub boundary_gap: Option<f64>, pub align_ticks: Option<bool>, pub grid_index: Option<usize>, pub offset: Option<f64>, pub axis_pointer: Option<AxisPointerOption>, pub formatter: Option<String>, pub color: Option<String>,
}
Expand description

The options of one axis.

Fields§

§axis_type: AxisType

The kind of the axis.

§data: Vec<DataValue>

The categories or the tick values of the axis.

§name: Option<String>

The name of the axis.

§name_location: Option<String>

The position of the axis’ name.

§name_gap: Option<f64>

The gap between the axis’ name and the axis.

§name_text_style: Option<LabelOption>

The style of the axis’ name.

§position: Option<Position>

The position of the axis.

§show: bool

Whether the axis is drawn.

§axis_label: Option<LabelOption>

The labels of the axis.

§axis_line: Option<AxisLineOption>

The line of the axis.

§axis_tick: Option<AxisTickOption>

The tick marks of the axis.

§split_line: Option<SplitLineOption>

The split lines of the axis.

§min: Option<f64>

The minimum value of the axis.

§max: Option<f64>

The maximum value of the axis.

§split_gap: Option<f64>

The gap between the axis and its split lines, as a fraction of the axis’ length.

§split_number: Option<usize>

The number of split lines.

§interval: Option<f64>

The interval between two split lines.

§min_interval: Option<f64>

The minimum interval between two split lines.

§max_interval: Option<f64>

The maximum interval between two split lines.

§log_base: Option<f64>

Whether the axis uses a logarithmic scale.

§boundary_gap: Option<f64>

The boundary gap of a category axis.

§align_ticks: Option<bool>

Whether the axis is aligned with the other axis of the same grid.

§grid_index: Option<usize>

The index of the grid the axis belongs to.

§offset: Option<f64>

Whether the axis is drawn on the other side of the grid.

§axis_pointer: Option<AxisPointerOption>

The colour of the axis’ area.

§formatter: Option<String>

The formatter used for the axis’ labels.

§color: Option<String>

The colour of the axis.

Implementations§

Source§

impl AxisOption

Inherent implementation of AxisOption.

Source

pub fn category() -> Self

Returns a category axis.

Source

pub fn value() -> Self

Returns a value axis.

Source

pub fn time() -> Self

Returns a time axis.

Source

pub fn log() -> Self

Returns a logarithmic axis.

Source

pub fn data(self, data: Vec<DataValue>) -> Self

Sets the categories or the tick values of the axis.

§Arguments
  • Vec<DataValue> - A Vec<DataValue> parameter.
Source

pub fn name(self, name: &str) -> Self

Sets the name of the axis.

§Arguments
  • &str - Shared reference to a str.
Source

pub fn axis_label(self, label: LabelOption) -> Self

Sets the labels of the axis.

§Arguments
  • LabelOption - A LabelOption parameter.
Source

pub fn axis_line(self, line: AxisLineOption) -> Self

Sets the line of the axis.

§Arguments
  • AxisLineOption - A AxisLineOption parameter.
Source

pub fn axis_tick(self, tick: AxisTickOption) -> Self

Sets the tick marks of the axis.

§Arguments
  • AxisTickOption - A AxisTickOption parameter.
Source

pub fn split_line(self, line: SplitLineOption) -> Self

Sets the split lines of the axis.

§Arguments
  • SplitLineOption - A SplitLineOption parameter.
Source

pub fn min(self, min: f64) -> Self

Sets the minimum value of the axis.

§Arguments
  • f64 - A 64-bit float (f64).
Source

pub fn max(self, max: f64) -> Self

Sets the maximum value of the axis.

§Arguments
  • f64 - A 64-bit float (f64).
Source§

impl AxisOption

Source

pub fn get_axis_type(&self) -> AxisType

Source

pub fn get_mut_axis_type(&mut self) -> &mut AxisType

Source

pub fn set_axis_type(&mut self, val: AxisType) -> &mut Self

Source

pub fn get_data(&self) -> &Vec<DataValue>

Source

pub fn get_mut_data(&mut self) -> &mut Vec<DataValue>

Source

pub fn set_data(&mut self, val: Vec<DataValue>) -> &mut Self

Source

pub fn get_name(&self) -> Option<String>

Source

pub fn try_get_name(&self) -> Option<String>

Source

pub fn get_mut_name(&mut self) -> &mut Option<String>

Source

pub fn set_name(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_name_location(&self) -> Option<String>

Source

pub fn try_get_name_location(&self) -> Option<String>

Source

pub fn get_mut_name_location(&mut self) -> &mut Option<String>

Source

pub fn set_name_location(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_name_gap(&self) -> Option<f64>

Source

pub fn try_get_name_gap(&self) -> Option<f64>

Source

pub fn get_mut_name_gap(&mut self) -> &mut Option<f64>

Source

pub fn set_name_gap(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_name_text_style(&self) -> Option<LabelOption>

Source

pub fn try_get_name_text_style(&self) -> Option<LabelOption>

Source

pub fn get_mut_name_text_style(&mut self) -> &mut Option<LabelOption>

Source

pub fn set_name_text_style(&mut self, val: Option<LabelOption>) -> &mut Self

Source

pub fn get_position(&self) -> Option<Position>

Source

pub fn try_get_position(&self) -> Option<Position>

Source

pub fn get_mut_position(&mut self) -> &mut Option<Position>

Source

pub fn set_position(&mut self, val: Option<Position>) -> &mut Self

Source

pub fn get_show(&self) -> bool

Source

pub fn get_mut_show(&mut self) -> &mut bool

Source

pub fn set_show(&mut self, val: bool) -> &mut Self

Source

pub fn get_axis_label(&self) -> Option<LabelOption>

Source

pub fn try_get_axis_label(&self) -> Option<LabelOption>

Source

pub fn get_mut_axis_label(&mut self) -> &mut Option<LabelOption>

Source

pub fn set_axis_label(&mut self, val: Option<LabelOption>) -> &mut Self

Source

pub fn get_axis_line(&self) -> Option<AxisLineOption>

Source

pub fn try_get_axis_line(&self) -> Option<AxisLineOption>

Source

pub fn get_mut_axis_line(&mut self) -> &mut Option<AxisLineOption>

Source

pub fn set_axis_line(&mut self, val: Option<AxisLineOption>) -> &mut Self

Source

pub fn get_axis_tick(&self) -> Option<AxisTickOption>

Source

pub fn try_get_axis_tick(&self) -> Option<AxisTickOption>

Source

pub fn get_mut_axis_tick(&mut self) -> &mut Option<AxisTickOption>

Source

pub fn set_axis_tick(&mut self, val: Option<AxisTickOption>) -> &mut Self

Source

pub fn get_split_line(&self) -> Option<SplitLineOption>

Source

pub fn try_get_split_line(&self) -> Option<SplitLineOption>

Source

pub fn get_mut_split_line(&mut self) -> &mut Option<SplitLineOption>

Source

pub fn set_split_line(&mut self, val: Option<SplitLineOption>) -> &mut Self

Source

pub fn get_min(&self) -> Option<f64>

Source

pub fn try_get_min(&self) -> Option<f64>

Source

pub fn get_mut_min(&mut self) -> &mut Option<f64>

Source

pub fn set_min(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_max(&self) -> Option<f64>

Source

pub fn try_get_max(&self) -> Option<f64>

Source

pub fn get_mut_max(&mut self) -> &mut Option<f64>

Source

pub fn set_max(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_split_gap(&self) -> Option<f64>

Source

pub fn try_get_split_gap(&self) -> Option<f64>

Source

pub fn get_mut_split_gap(&mut self) -> &mut Option<f64>

Source

pub fn set_split_gap(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_split_number(&self) -> Option<usize>

Source

pub fn try_get_split_number(&self) -> Option<usize>

Source

pub fn get_mut_split_number(&mut self) -> &mut Option<usize>

Source

pub fn set_split_number(&mut self, val: Option<usize>) -> &mut Self

Source

pub fn get_interval(&self) -> Option<f64>

Source

pub fn try_get_interval(&self) -> Option<f64>

Source

pub fn get_mut_interval(&mut self) -> &mut Option<f64>

Source

pub fn set_interval(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_min_interval(&self) -> Option<f64>

Source

pub fn try_get_min_interval(&self) -> Option<f64>

Source

pub fn get_mut_min_interval(&mut self) -> &mut Option<f64>

Source

pub fn set_min_interval(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_max_interval(&self) -> Option<f64>

Source

pub fn try_get_max_interval(&self) -> Option<f64>

Source

pub fn get_mut_max_interval(&mut self) -> &mut Option<f64>

Source

pub fn set_max_interval(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_log_base(&self) -> Option<f64>

Source

pub fn try_get_log_base(&self) -> Option<f64>

Source

pub fn get_mut_log_base(&mut self) -> &mut Option<f64>

Source

pub fn set_log_base(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_boundary_gap(&self) -> Option<f64>

Source

pub fn try_get_boundary_gap(&self) -> Option<f64>

Source

pub fn get_mut_boundary_gap(&mut self) -> &mut Option<f64>

Source

pub fn set_boundary_gap(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_align_ticks(&self) -> Option<bool>

Source

pub fn try_get_align_ticks(&self) -> Option<bool>

Source

pub fn get_mut_align_ticks(&mut self) -> &mut Option<bool>

Source

pub fn set_align_ticks(&mut self, val: Option<bool>) -> &mut Self

Source

pub fn get_grid_index(&self) -> Option<usize>

Source

pub fn try_get_grid_index(&self) -> Option<usize>

Source

pub fn get_mut_grid_index(&mut self) -> &mut Option<usize>

Source

pub fn set_grid_index(&mut self, val: Option<usize>) -> &mut Self

Source

pub fn get_offset(&self) -> Option<f64>

Source

pub fn try_get_offset(&self) -> Option<f64>

Source

pub fn get_mut_offset(&mut self) -> &mut Option<f64>

Source

pub fn set_offset(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_axis_pointer(&self) -> Option<AxisPointerOption>

Source

pub fn try_get_axis_pointer(&self) -> Option<AxisPointerOption>

Source

pub fn get_mut_axis_pointer(&mut self) -> &mut Option<AxisPointerOption>

Source

pub fn set_axis_pointer(&mut self, val: Option<AxisPointerOption>) -> &mut Self

Source

pub fn get_formatter(&self) -> Option<String>

Source

pub fn try_get_formatter(&self) -> Option<String>

Source

pub fn get_mut_formatter(&mut self) -> &mut Option<String>

Source

pub fn set_formatter(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_color(&self) -> Option<String>

Source

pub fn try_get_color(&self) -> Option<String>

Source

pub fn get_mut_color(&mut self) -> &mut Option<String>

Source

pub fn set_color(&mut self, val: Option<String>) -> &mut Self

Trait Implementations§

Source§

impl Clone for AxisOption

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AxisOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AxisOption

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AxisOption

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AxisOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more