Skip to main content

TooltipOptions

Struct TooltipOptions 

Source
#[non_exhaustive]
pub struct TooltipOptions {
Show 19 fields pub enabled: bool, pub on_long_press: bool, pub mode: TooltipMode, pub show_ohlc: bool, pub show_volume: bool, pub show_volume_details: bool, pub show_change: bool, pub show_time: bool, pub show_indicators: bool, pub magnifier_zoom: f32, pub magnifier_size: f32, pub background_color: Color32, pub text_color: Color32, pub border_color_bullish: Color32, pub border_color_bearish: Color32, pub font_size: f32, pub price_precision: usize, pub tracking_bar_height: f32, pub tracking_bar_background: Color32,
}
Expand description

Tooltip configuration options

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§enabled: bool

Whether the hover readout is drawn at all.

When false the chart still shows the crosshair but suppresses the OHLC/value readout, matching charting UIs that let users toggle the data tooltip independently of the crosshair.

§on_long_press: bool

Show values only while the primary pointer is held. Touch waits for a long press.

§mode: TooltipMode

Tooltip display mode

§show_ohlc: bool

Show OHLC values (Open, High, Low, Close)

§show_volume: bool

Show volume

§show_volume_details: bool

Include volume study plot details in held values, in addition to total volume. Other study values and hover readouts retain their existing visibility.

§show_change: bool

Show price change (absolute and percentage)

§show_time: bool

Show ts

§show_indicators: bool

Show indicator values (if indicators are present)

§magnifier_zoom: f32

Magnifier zoom level (2.0 = 2x zoom, 3.0 = 3x zoom), drawn within 0.1 to 100 (NaN as 0.1) Only applies when mode is Magnifier

§magnifier_size: f32

Magnifier lens diameter in pixels, drawn no larger than the plot’s smaller side Only applies when mode is Magnifier

§background_color: Color32

Background color for floating tooltip (Color32::PLACEHOLDER: active theme)

§text_color: Color32

Text color for tooltip content (Color32::PLACEHOLDER: active theme)

§border_color_bullish: Color32

Border color for the floating tooltip of a rising bar (Color32::PLACEHOLDER: active theme)

§border_color_bearish: Color32

Border color for the floating tooltip of a falling bar (Color32::PLACEHOLDER: active theme)

§font_size: f32

Font size for tooltip text

§price_precision: usize

Most decimals for price values. The floating tooltip shows fewer for prices whose magnitude needs fewer; the tracking bar shows this many, at most 4.

§tracking_bar_height: f32

Tracking bar height (for Tracking mode)

§tracking_bar_background: Color32

Tracking bar background color (Color32::PLACEHOLDER: active theme)

Implementations§

Source§

impl TooltipOptions

Source

pub fn floating() -> Self

Create tooltip options with floating mode

Source

pub fn tracking() -> Self

Create tooltip options with tracking mode

Source

pub fn magnifier() -> Self

Create tooltip options with magnifier mode

Source

pub fn magnifier_with_zoom(zoom: f32) -> Self

Create magnifier with custom zoom level

Source

pub fn with_mode(self, mode: TooltipMode) -> Self

Set tooltip mode

Source

pub fn with_enabled(self, enabled: bool) -> Self

Enable or disable the hover readout.

Source

pub fn with_ohlc(self, show: bool) -> Self

Enable/disable OHLC display

Source

pub fn with_volume(self, show: bool) -> Self

Enable/disable volume display

Source

pub fn with_change(self, show: bool) -> Self

Enable/disable change display

Source

pub fn with_magnifier_zoom(self, zoom: f32) -> Self

Set magnifier zoom level

Source

pub fn with_magnifier_size(self, size: f32) -> Self

Set magnifier size

Source

pub fn with_precision(self, precision: usize) -> Self

Set price precision

Trait Implementations§

Source§

impl Clone for TooltipOptions

Source§

fn clone(&self) -> TooltipOptions

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 TooltipOptions

Source§

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

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

impl Default for TooltipOptions

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for TooltipOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TooltipOptions

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for TooltipOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TooltipOptions

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.