Skip to main content

ChartView

Struct ChartView 

Source
pub struct ChartView<'a> {
Show 13 fields pub instrument: Option<&'a Instrument>, pub price_formatter: Option<&'a dyn PriceFormatter>, pub time_formatter: Option<&'a dyn TimeFormatter>, pub bar_seconds: i64, pub bars: &'a [Bar], pub revision: u64, pub bar_to_x: &'a dyn Fn(f32) -> f32, pub price_to_y: &'a dyn Fn(f64) -> f32, pub y_to_price: &'a dyn Fn(f32) -> f64, pub time_axis: bool, pub executions: Option<&'a Footprint>, pub timeframe: Option<Timeframe>, pub finer: &'a [StudyData<'a>],
}
Expand description

The bars and coordinate mapping that drawings are rendered against.

Drawing anchors index into bars. The anchored VWAP, both volume profiles, the regression trend, the position and forecast results and the bars pattern are computed from these bars.

Fields§

§instrument: Option<&'a Instrument>

Instrument metadata supplied by the host or feed, for tick and pip measurements.

§price_formatter: Option<&'a dyn PriceFormatter>

The host’s raw-price formatter for the series the drawings belong to, from Chart::set_series_formatter or else Chart::set_price_formatter. Drawing prices and price changes use its format; None keeps their built-in decimals.

§time_formatter: Option<&'a dyn TimeFormatter>

The chart’s time formatter, which writes times in its display time zone with its locale, date format, clock visibility and the host’s TimeFormatter. Drawings write the dates they print with its format_crosshair and bar_seconds, as the crosshair time label does; None keeps their built-in UTC dates. Custom renderers can use it the same way.

§bar_seconds: i64

The bar duration in seconds that the chart passes to time_formatter’s format_crosshair for the crosshair time label, which sets how much of the clock a date shows. Unused without time_formatter.

§bars: &'a [Bar]

The series that drawing anchors index into.

§revision: u64

ChartState::revision of bars. Results computed from the bars are cached under it, so it must change whenever a bar before the last one changes.

§bar_to_x: &'a dyn Fn(f32) -> f32

Screen x of a (fractional) bar index.

§price_to_y: &'a dyn Fn(f64) -> f32

Screen y of a price.

§y_to_price: &'a dyn Fn(f32) -> f64

Price at a screen y, using the same scale and orientation as price_to_y.

§time_axis: bool

Whether the bar times are times, so measurements show the time between anchors; false on a horizontal scale other than time.

§executions: Option<&'a Footprint>

The executions behind bars, aggregated on the bars’ clock. The volume profile drawings then show the executed volume at each price, split by aggressor side, instead of spreading bar volume over bar ranges; None estimates from the bars.

§timeframe: Option<Timeframe>

Interval of bars, or None for price-based chart types, trade-based intervals and horizontal scales other than time. Volume profiles read finer bars only with an interval.

§finer: &'a [StudyData<'a>]

Histories of this symbol at the intervals that Chart::study_data_requests lists for its drawings. Without executions in their span, profile drawings use the interval Instrument::profile_resolutions suggests, replacing covered chart bars with finer bars; &[] estimates from bars.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ChartView<'a>

§

impl<'a> !Send for ChartView<'a>

§

impl<'a> !Sync for ChartView<'a>

§

impl<'a> !UnwindSafe for ChartView<'a>

§

impl<'a> Freeze for ChartView<'a>

§

impl<'a> Unpin for ChartView<'a>

§

impl<'a> UnsafeUnpin for ChartView<'a>

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

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

§

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