pub struct ChartSettingsState {Show 21 fields
pub chart_type: ChartType,
pub chart_type_params: Option<ChartTypeParams>,
pub price_source: Option<PriceSource>,
pub candle_colors: CandleColorConfig,
pub precision: PrecisionMode,
pub timezone: String,
pub show_price_targets: bool,
pub adjust_for_dividends: bool,
pub order_flow: OrderFlowSettings,
pub status_line: StatusLineOptions,
pub scales_and_lines: ScalesAndLinesSettings,
pub chart_basic_styles: ChartBasicStylesSettings,
pub grid_lines: GridLinesSettings,
pub crosshair: CrosshairSettings,
pub watermark: WatermarkSettings,
pub scales_appearance: ScalesAppearanceSettings,
pub btns: ButtonsSettings,
pub margins: MarginsSettings,
pub trading: TradingSettings,
pub alerts: AlertsSettings,
pub events: EventVisibility,
}Expand description
Serializable display settings shared by the chart and its settings dialog.
Fields§
§chart_type: ChartTypeActive representation used to select the Symbol controls. Applying settings keeps the chart type.
chart_type_params: Option<ChartTypeParams>Styles and construction inputs; absent in settings saved before these controls existed.
price_source: Option<PriceSource>Source for line and area representations; absent in older saved settings.
candle_colors: CandleColorConfigCandle body, border and wick colors.
precision: PrecisionModePrice display precision.
timezone: StringUTC, Local, or a supported zone name.
show_price_targets: boolShow analyst estimates answered by the host feed.
adjust_for_dividends: boolAsk the host for history adjusted for dividends. The host owns the data, so
apply_to_chart leaves it to the host, which reloads the
adjusted history; from_chart leaves it off.
order_flow: OrderFlowSettingsIndependent heatmap, live book and trade bubble settings; older documents keep them off.
status_line: StatusLineOptionsLegend content and quote controls.
scales_and_lines: ScalesAndLinesSettingsPrice scale and reference line settings.
chart_basic_styles: ChartBasicStylesSettingsChart background settings.
grid_lines: GridLinesSettingsGrid directions and colors.
crosshair: CrosshairSettingsCrosshair line appearance.
watermark: WatermarkSettingsWatermark appearance.
scales_appearance: ScalesAppearanceSettingsAxis appearance.
btns: ButtonsSettingsChart and pane control visibility.
margins: MarginsSettingsSpace around the visible prices.
trading: TradingSettingsHost trading controls and overlays.
alerts: AlertsSettingsAlert marks and labels.
events: EventVisibilityVisible event categories.
Implementations§
Source§impl ChartSettingsState
impl ChartSettingsState
Sourcepub fn from_chart(chart: &Chart) -> Self
pub fn from_chart(chart: &Chart) -> Self
Read the chart’s current display settings. Host-managed trading and alert groups retain defaults; hosts preserve their current values when refreshing chart settings.
Sourcepub fn apply_to_chart(
&self,
chart: &mut Chart,
) -> Result<(), ChartSettingsError>
pub fn apply_to_chart( &self, chart: &mut Chart, ) -> Result<(), ChartSettingsError>
Apply the display controls offered by the dialog without rebuilding the chart or feed. Host-owned trading and alerts are left to their providers. Invalid timezone, margins or crosshair width returns an error before changing the chart.
Trait Implementations§
Source§impl Clone for ChartSettingsState
impl Clone for ChartSettingsState
Source§fn clone(&self) -> ChartSettingsState
fn clone(&self) -> ChartSettingsState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChartSettingsState
impl Debug for ChartSettingsState
Source§impl Default for ChartSettingsState
impl Default for ChartSettingsState
Source§impl<'de> Deserialize<'de> for ChartSettingsState
impl<'de> Deserialize<'de> for ChartSettingsState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ChartSettingsState
impl PartialEq for ChartSettingsState
Source§impl Serialize for ChartSettingsState
impl Serialize for ChartSettingsState
impl StructuralPartialEq for ChartSettingsState
Auto Trait Implementations§
impl Freeze for ChartSettingsState
impl RefUnwindSafe for ChartSettingsState
impl Send for ChartSettingsState
impl Sync for ChartSettingsState
impl Unpin for ChartSettingsState
impl UnsafeUnpin for ChartSettingsState
impl UnwindSafe for ChartSettingsState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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