Skip to main content

ChartType

Enum ChartType 

Source
#[non_exhaustive]
pub enum ChartType {
Show 21 variants Bars, Candles, HollowCandles, VolumeCandles, Line, LineWithMarkers, StepLine, Area, HlcArea, Baseline, Columns, HighLow, Range, Renko, Kagi, LineBreak, Heikin, PointAndFigure, TimePriceOpportunity, VolumeFootprint, SessionVolumeProfile,
}
Expand description

Chart visualization types

Each variant represents a distinct way to visualize OHLCV data. The default is Candles (Japanese candlesticks).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Bars

Traditional OHLC bars with tick marks

§

Candles

Japanese candlesticks (default)

§

HollowCandles

Hollow when close > open, filled when close < open

§

VolumeCandles

Candle body width proportional to the bar’s volume over the largest visible volume; a zero volume draws a body as thin as the wick

§

Line

Price line, using the close by default.

§

LineWithMarkers

Line with circular markers at each data point

§

StepLine

Stepped line (horizontal then vertical)

§

Area

Filled area under close price line

§

HlcArea

High-Low-Close area chart

§

Baseline

Baseline comparison chart with colored fill

§

Columns

One column per bar, colored by close versus the previous close. The base is the pane bottom unless ChartTypeParams::columns_base is set.

§

HighLow

High-Low range visualization

§

Range

Range bars (price-based, time-independent)

§

Renko

Renko bricks (price movement only)

§

Kagi

Kagi chart (trend reversals)

§

LineBreak

Line Break chart with a configurable reversal lookback.

§

Heikin

Heikin-Ashi candles (smoothed)

§

PointAndFigure

Point and Figure (X and O columns)

§

TimePriceOpportunity

Time Price Opportunity (Market Profile)

§

VolumeFootprint

Bid and ask volume at each price of every bar, summed from the trades the feed sends on the instrument’s tick size. Requires a time-based interval and an instrument tick size; otherwise draws candles, as do bars before the first held trade.

§

SessionVolumeProfile

Volume at each price of every session of the visible bars, with its point of control and value area, summed like VolumeFootprint. Draws candles without the studies feature.

Implementations§

Source§

impl ChartType

Source

pub fn all() -> &'static [ChartType]

All chart types in display order

Source

pub fn name(&self) -> &'static str

User-facing display name

Source

pub fn as_str(&self) -> &'static str

Alias for name() for string compatibility

Source

pub fn description(&self) -> &'static str

Technical description for tooltips

Source

pub fn desc(&self) -> &'static str

Alias for description() for compatibility

Source

pub fn category(&self) -> ChartTypeCategory

Category this chart type belongs to

Source

pub fn in_category(category: ChartTypeCategory) -> Vec<ChartType>

Get all chart types in a specific category

Source

pub fn uses_ohlc(&self) -> bool

Whether this chart type uses OHLC data (vs single value)

Source

pub fn supports_volume(&self) -> bool

Whether this chart type supports volume display

Source

pub fn requires_parameters(&self) -> bool

Whether this chart type requires special parameters

Source

pub fn is_time_independent(&self) -> bool

Whether this chart type is time-independent, with one time-scale slot per element. Studies, drawings and markers are kept but not drawn, hit or edited on these types.

Source

pub fn transforms_data(&self) -> bool

Whether this chart type transforms the input data

Trait Implementations§

Source§

impl ChartTypeUiExt for ChartType

Source§

fn icon(&self) -> &'static Icon

Get the icon for this chart type
Source§

impl Clone for ChartType

Source§

fn clone(&self) -> ChartType

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 ChartType

Source§

impl Debug for ChartType

Source§

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

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

impl Default for ChartType

Source§

fn default() -> ChartType

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

impl<'de> Deserialize<'de> for ChartType

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 Display for ChartType

Source§

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

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

impl Eq for ChartType

Source§

impl Hash for ChartType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ChartType

Source§

fn eq(&self, other: &ChartType) -> 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 ChartType

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 ChartType

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
§

impl<T> AsId for T
where T: Hash + Debug,

§

impl<T> AsIdSalt for T
where T: Hash + Debug,

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

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.