pub struct Legend<'a> {Show 25 fields
pub formatters: ValueFormatters<'a>,
pub symbol: &'a str,
pub timeframe: &'a str,
pub instrument: Option<&'a Instrument>,
pub bar: &'a Bar,
pub previous_close: Option<f64>,
pub quote: Option<&'a Level1Quote>,
pub badge: Option<ImageSource<'a>>,
pub show_logo: bool,
pub show_market_status: bool,
pub statuses: &'a [LegendStatus<'a>],
pub studies: &'a [Box<dyn Indicator>],
pub study_inputs: &'a [&'a str],
pub bar_index: usize,
pub show_volume: bool,
pub show_title: bool,
pub title_as_description: bool,
pub show_ohlc: bool,
pub show_change: bool,
pub show_change_percent: bool,
pub show_indicator_titles: bool,
pub show_indicator_inputs: bool,
pub show_indicator_values: bool,
pub day_change: Option<(f64, f64)>,
pub study_backdrop: f32,
/* private fields */
}Expand description
An in-pane legend. Historical readout data and current quotes are supplied independently.
Fields§
§formatters: ValueFormatters<'a>Host number formatting for this series’ readouts.
symbol: &'a strFallback title when the instrument has no description.
timeframe: &'a strDisplay interval.
instrument: Option<&'a Instrument>Description, exchange and price precision reported by the host.
bar: &'a BarThe bar selected by the crosshair, or the latest bar when none is selected.
previous_close: Option<f64>Close of the bar preceding bar, including when it is outside the viewport.
quote: Option<&'a Level1Quote>Current host quote, independent of bar. Invalid or crossed quotes are omitted.
badge: Option<ImageSource<'a>>Image for the symbol mark before the title, in place of the instrument’s logo.
show_logo: boolShow the symbol mark before the title: badge, else the instrument’s
logo, else the symbol’s first letter or digit on a neutral disc.
show_market_status: boolShow the market status after the title: the session’s state, when known, and delayed or end-of-day data.
statuses: &'a [LegendStatus<'a>]Optional host-owned status marks.
studies: &'a [Box<dyn Indicator>]Studies on the chart. Overlay studies retain a row while hidden so they can be shown again.
study_inputs: &'a [&'a str]Display inputs supplied by the host, in studies order. Missing entries are omitted.
bar_index: usizeGlobal index of bar in each study’s values.
show_volume: boolWhether this series has volume.
show_title: boolDisplay the title row: the symbol mark, the instrument title and the status marks.
title_as_description: boolPrefer the host description over the ticker.
show_ohlc: boolDisplay OHLC fields, or the close alone in a compact plot.
show_change: boolDisplay absolute bar change.
show_change_percent: boolDisplay percentage bar change.
show_indicator_titles: boolDisplay study names.
show_indicator_inputs: boolDisplay supplied study inputs.
show_indicator_values: boolDisplay study outputs.
day_change: Option<(f64, f64)>The previous session’s close and the last price, shown after the bar change as the change between them.
study_backdrop: f32Opacity from 0 to 1 of the chart background behind the volume and study rows. Text and controls retain opaque backing so profiles cannot interfere with them.
Implementations§
Source§impl<'a> Legend<'a>
impl<'a> Legend<'a>
Sourcepub fn new(symbol: &'a str, timeframe: &'a str, bar: &'a Bar) -> Self
pub fn new(symbol: &'a str, timeframe: &'a str, bar: &'a Bar) -> Self
A series readout with volume and no optional host metadata or quotes.
Sourcepub fn show(&self, ui: &mut Ui, plot: Rect) -> Option<QuoteSide>
pub fn show(&self, ui: &mut Ui, plot: Rect) -> Option<QuoteSide>
Paints inside plot, inset by the theme’s large spacing from its sides and medium
spacing from its top and bottom, and reports a quote intent.
Supplementary volume and study rows collapse together; quotes remain visible.
Sourcepub fn show_with_study_actions(
&self,
ui: &mut Ui,
plot: Rect,
) -> (Option<QuoteSide>, Option<StudyAction>)
pub fn show_with_study_actions( &self, ui: &mut Ui, plot: Rect, ) -> (Option<QuoteSide>, Option<StudyAction>)
Paint the legend and report quote and study intents independently.
Each study intent identifies its zero-based index in studies.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Legend<'a>
impl<'a> !Send for Legend<'a>
impl<'a> !Sync for Legend<'a>
impl<'a> !UnwindSafe for Legend<'a>
impl<'a> Freeze for Legend<'a>
impl<'a> Unpin for Legend<'a>
impl<'a> UnsafeUnpin for Legend<'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