Skip to main content

SeriesSettings

Struct SeriesSettings 

Source
pub struct SeriesSettings {
Show 25 fields pub chart_type: ChartType, pub chart_type_params: ChartTypeParams, pub bullish_color: Color32, pub bearish_color: Color32, pub bullish_border_color: Option<Color32>, pub bearish_border_color: Option<Color32>, pub bullish_wick_color: Option<Color32>, pub bearish_wick_color: Option<Color32>, pub price_source: PriceSource, pub visible_all_timeframes: bool, pub visible_timeframes: Vec<String>, pub show_ohlc_values: bool, pub show_change: bool, pub show_volume: bool, pub show_bar_change: bool, pub decimal_places: u8, pub price_scale_mode: PriceScaleMode, pub show_price_line: bool, pub show_prev_close_line: bool, pub invert_scale: bool, pub alerts: SeriesAlerts, pub background_type: u8, pub show_vertical_grid: bool, pub show_horizontal_grid: bool, pub crosshair_mode: u8,
}
Expand description

Settings for chart series appearance

Fields§

§chart_type: ChartType

Active chart type, used by the dialog to choose the controls to show. Applying settings keeps the chart’s currently selected type.

§chart_type_params: ChartTypeParams

Retained styles and chart type parameters.

§bullish_color: Color32

Bullish candle body color

§bearish_color: Color32

Bearish candle body color

§bullish_border_color: Option<Color32>

Bullish candle border color (None = same as fill)

§bearish_border_color: Option<Color32>

Bearish candle border color (None = same as fill)

§bullish_wick_color: Option<Color32>

Bullish wick color (None = same as fill)

§bearish_wick_color: Option<Color32>

Bearish wick color (None = same as fill)

§price_source: PriceSource

Price source for line calculations

§visible_all_timeframes: bool

Whether to show on all timeframes

§visible_timeframes: Vec<String>

Specific visible timeframes (when not all)

§show_ohlc_values: bool

Show OHLC values in status line

§show_change: bool

Show price change in status line

§show_volume: bool

Show volume in status line

§show_bar_change: bool

Show bar change (open to close) in status line

§decimal_places: u8

Decimal places for price display

§price_scale_mode: PriceScaleMode

Price scale mode (Normal, Log, Percentage, IndexedTo100)

§show_price_line: bool

Show last price horizontal line

§show_prev_close_line: bool

Show previous close line

§invert_scale: bool

Invert the price scale

§alerts: SeriesAlerts

Visibility and style of this series’ alert levels

§background_type: u8

Background type: 0 = Solid, 1 = Gradient

§show_vertical_grid: bool

Show vertical grid lines

§show_horizontal_grid: bool

Show horizontal grid lines

§crosshair_mode: u8

Crosshair mode: 0 = Full, 1 = Cross, 2 = None

Implementations§

Source§

impl SeriesSettings

Source

pub fn new() -> Self

Create new settings with default values

Source

pub fn effective_bullish_border(&self) -> Color32

Get the effective bullish border color

Source

pub fn effective_bearish_border(&self) -> Color32

Get the effective bearish border color

Source

pub fn effective_bullish_wick(&self) -> Color32

Get the effective bullish wick color

Source

pub fn effective_bearish_wick(&self) -> Color32

Get the effective bearish wick color

Source

pub fn reset_to_default(&mut self)

Reset settings to defaults, keeping the active chart type for dialog context.

Source

pub fn compute_line_value( &self, open: f64, high: f64, low: f64, close: f64, ) -> f64

Compute the line value for a bar based on the configured price source.

Use this when rendering line charts to respect the user’s price source selection. For example: settings.compute_line_value(bar.open, bar.high, bar.low, bar.close)

Source

pub fn compute_line_values(&self, bars: &[Bar]) -> Vec<f64>

Compute line values for a slice of bars based on price source.

Returns a Vec of computed values matching the input bars.

Trait Implementations§

Source§

impl Clone for SeriesSettings

Source§

fn clone(&self) -> SeriesSettings

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 SeriesSettings

Source§

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

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

impl Default for SeriesSettings

Source§

fn default() -> Self

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

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> 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.