Skip to main content

SeriesOptions

Struct SeriesOptions 

Source
pub struct SeriesOptions {
Show 13 fields pub price_precision: Option<u8>, pub source: Option<SeriesId>, pub color: Option<Rgba>, pub down_color: Option<Rgba>, pub top_fill: Option<Rgba>, pub bottom_fill: Option<Rgba>, pub line_width: Css, pub line_style: LineDash, pub step: bool, pub base_value: f64, pub last_value_visible: bool, pub price_line_visible: bool, pub shift: i32,
}
Expand description

Options of a series. Colors left at None come from the theme.

§Examples

use ferrochart_core::chart::SeriesOptions;
use ferrochart_core::data::SeriesId;
use ferrochart_core::geom::{Css, Rgba};

let opts = SeriesOptions::volume_of(SeriesId(0));
assert_eq!(opts.source, Some(SeriesId(0)));

let line = SeriesOptions {
    color: Some(Rgba::hex(0x00FF_6D00)),
    line_width: Css(1.0),
    ..SeriesOptions::default()
};

Fields§

§price_precision: Option<u8>

Decimal places of price labels; None (the default) is automatic: at least 2 decimals and 4 significant digits of the visible values, with a subscript count of zeros for small prices (0.0₄1234).

§source: Option<SeriesId>

For SeriesKind::Volume: the OHLC series whose volume is drawn.

§color: Option<Rgba>

Main color: the line of Line/Area, the bars of Histogram, up candles and bars, the line of Baseline above its base.

§down_color: Option<Rgba>

Down candles and bars; the line of Baseline below its base.

§top_fill: Option<Rgba>

Fill at the top of an Area; fill above the base of a Baseline.

§bottom_fill: Option<Rgba>

Fill at the bottom of an Area; fill below the base of a Baseline.

§line_width: Css

Line width of Line, Area and Baseline.

§line_style: LineDash

Dash pattern of the line.

§step: bool

Step line: horizontal to the next point’s time, then vertical.

§base_value: f64

Base value of Baseline (fill boundary) and Histogram (bar base).

§last_value_visible: bool

Label with the last value on the price axis. Not drawn for volume series.

§price_line_visible: bool

Dotted horizontal line at the last value. Not drawn for volume series.

§shift: i32

Display shift in bars: the point at logical index j is drawn at j + shift (Ichimoku’s leading spans and lagging line). Autoscale and the crosshair follow the drawn positions.

Implementations§

Source§

impl SeriesOptions

Source

pub fn volume_of(source: SeriesId) -> Self

Options of a volume series that draws source’s volume column.

Trait Implementations§

Source§

impl Clone for SeriesOptions

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 Copy for SeriesOptions

Source§

impl Debug for SeriesOptions

Source§

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

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

impl Default for SeriesOptions

Source§

fn default() -> Self

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

impl PartialEq for SeriesOptions

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 SeriesOptions

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.