Skip to main content

TooltipOption

Struct TooltipOption 

Source
pub struct TooltipOption {
Show 14 fields pub show: bool, pub trigger: TriggerType, pub formatter: Option<String>, pub background_color: Option<String>, pub border_color: Option<String>, pub border_width: Option<f64>, pub padding: Option<(f64, f64, f64, f64)>, pub text_style: Option<LabelOption>, pub position: Option<Vec<f64>>, pub confine: Option<bool>, pub axis_pointer: Option<AxisPointerOption>, pub extra_css_text: Option<String>, pub transition_duration: Option<f64>, pub order: Option<String>,
}
Expand description

The options of the chart’s tooltip.

Fields§

§show: bool

Whether the tooltip is drawn.

§trigger: TriggerType

What the tooltip describes.

§formatter: Option<String>

The formatter of the tooltip’s content.

§background_color: Option<String>

The background colour of the tooltip.

§border_color: Option<String>

The border colour of the tooltip.

§border_width: Option<f64>

The border width of the tooltip.

§padding: Option<(f64, f64, f64, f64)>

The padding inside the tooltip.

§text_style: Option<LabelOption>

The style of the tooltip’s text.

§position: Option<Vec<f64>>

The position of the tooltip, as [x, y] percentages.

§confine: Option<bool>

Whether the tooltip follows the pointer.

§axis_pointer: Option<AxisPointerOption>

Whether the tooltip is shown when the pointer is over the axis.

§extra_css_text: Option<String>

The extra CSS applied to the tooltip’s element.

§transition_duration: Option<f64>

The transition of the tooltip.

§order: Option<String>

The order the tooltip’s entries are sorted in.

Implementations§

Source§

impl TooltipOption

Inherent implementation of TooltipOption.

Source

pub fn new() -> Self

Returns a visible tooltip.

Source

pub fn trigger(self, trigger: TriggerType) -> Self

Sets what the tooltip describes.

§Arguments
  • TriggerType - A TriggerType parameter.
Source§

impl TooltipOption

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_trigger(&self) -> TriggerType

Source

pub fn get_mut_trigger(&mut self) -> &mut TriggerType

Source

pub fn set_trigger(&mut self, val: TriggerType) -> &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_background_color(&self) -> Option<String>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_padding(&self) -> Option<(f64, f64, f64, f64)>

Source

pub fn try_get_padding(&self) -> Option<(f64, f64, f64, f64)>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_position(&self) -> Option<Vec<f64>>

Source

pub fn try_get_position(&self) -> Option<Vec<f64>>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn set_confine(&mut self, val: Option<bool>) -> &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_extra_css_text(&self) -> Option<String>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for TooltipOption

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 TooltipOption

Source§

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

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

impl Default for TooltipOption

Source§

fn default() -> Self

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

impl PartialEq for TooltipOption

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 TooltipOption

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