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: i64The 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: u64ChartState::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) -> f32Screen x of a (fractional) bar index.
price_to_y: &'a dyn Fn(f64) -> f32Screen y of a price.
y_to_price: &'a dyn Fn(f32) -> f64Price at a screen y, using the same scale and orientation as price_to_y.
time_axis: boolWhether 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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