#[non_exhaustive]pub struct ChartConfig {Show 86 fields
pub bullish_color: Color32,
pub bearish_color: Color32,
pub bullish_border_color: Option<Color32>,
pub bearish_border_color: Option<Color32>,
pub bullish_wick_color: Option<Color32>,
pub bearish_wick_color: Option<Color32>,
pub price_source: PriceSource,
pub conflation_threshold: Option<f32>,
pub background_color: Color32,
pub background_style: BackgroundStyle,
pub grid_color: Color32,
pub vertical_grid_color: Option<Color32>,
pub grid_line_style: LineStyle,
pub vertical_grid_line_style: Option<LineStyle>,
pub text_color: Color32,
pub axis_font_size: Option<f32>,
pub thousands_sep: Option<char>,
pub candle_width: f32,
pub wick_width: f32,
pub candle_border_width: f32,
pub show_grid: bool,
pub show_horizontal_grid: bool,
pub show_vertical_grid: bool,
pub show_volume: bool,
pub volume_height_fraction: f32,
pub volume_baseline_inset: f32,
pub padding: f32,
pub show_time_labels: bool,
pub show_ohlc_info: bool,
pub title_as_description: bool,
pub show_quote_boxes: bool,
pub show_ohlc_change: bool,
pub show_ohlc_change_percent: bool,
pub show_legend_volume: bool,
pub show_indicator_inputs: bool,
pub show_legend_badge: bool,
pub show_market_status: bool,
pub show_last_day_change: bool,
pub indicator_backdrop_opacity: f32,
pub show_currency: bool,
pub show_unit: bool,
pub show_scale_mode_buttons: bool,
pub show_plus_button: bool,
pub show_extended_session_price: bool,
pub extended_session_price_color: Color32,
pub show_right_axis: bool,
pub show_left_axis: bool,
pub right_axis_width: f32,
pub left_axis_width: f32,
pub price_axis: PriceAxisOptions,
pub right_axis_scale_mode: PriceScaleMode,
pub left_axis_scale_mode: PriceScaleMode,
pub show_symbol_labels: bool,
pub show_symbol_last_val: bool,
pub show_price_line: bool,
pub show_prev_close_line: bool,
pub show_symbol_prev_close: bool,
pub show_indicator_labels: bool,
pub show_indicator_last_val: bool,
pub lock_price_to_bar_ratio: bool,
pub scale_price_chart_only: bool,
pub show_bid_ask: bool,
pub show_high_low: bool,
pub show_countdown: bool,
pub show_realtime_btn: bool,
pub realtime_button_pos: RealtimeButtonPos,
pub realtime_button_text: Option<String>,
pub realtime_button_size: (f32, f32),
pub realtime_button_color: Color32,
pub realtime_button_hover_color: Color32,
pub realtime_button_text_color: Color32,
pub navigation_buttons: NavigationButtons,
pub pane_buttons: NavigationButtons,
pub show_session_breaks: bool,
pub session_break_color: Color32,
pub session_break_style: LineStyle,
pub session_config: Option<SessionConfig>,
pub show_extended_hours: bool,
pub extended_hours_color: Color32,
pub show_watermark: bool,
pub watermark_text: Option<String>,
pub watermark_description: bool,
pub watermark_color: Color32,
pub watermark_font_size: f32,
pub watermark_pos: WatermarkPos,
pub skip_background: bool,
}Expand description
Configuration for chart visual appearance.
Controls every aspect of chart styling: candle/bar colors, grid lines, axis visibility, volume panel sizing, session break rendering, watermark overlay, and the real-time navigation button.
Defaults follow a common dark-theme charting palette.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bullish_color: Color32Color for bullish (up) bars/candles body
bearish_color: Color32Color for bearish (down) bars/candles body
bullish_border_color: Option<Color32>Border color for bullish candles (None = same as body)
bearish_border_color: Option<Color32>Border color for bearish candles (None = same as body)
bullish_wick_color: Option<Color32>Wick color for bullish candles (None = same as border or body)
bearish_wick_color: Option<Color32>Wick color for bearish candles (None = same as border or body)
price_source: PriceSourcePrice source for line-based charts (Line, Area, StepLine, etc.)
conflation_threshold: Option<f32>Minimum spacing in physical pixels for unmerged main-series samples; None disables
conflation. The default, Some(1.0), preserves the one-pixel grouping. Below the
threshold, consecutive bars form groups of the smallest power of two whose spacing
reaches it, capped at 2^30 bars. For example, 0.25 points at two pixels per point gives
groups of two at a threshold of 1, and four at a threshold of 2. Equality stays unmerged.
Non-positive and non-finite thresholds use 1. Price-based chart types stay unmerged;
gaps and per-bar colours keep their source samples even within a group.
Chart::prepare_conflation prepares these groups
before rendering. Saved configurations without this field keep the default.
background_color: Color32Background color for the chart (used when background_style is Solid)
background_style: BackgroundStyleBackground style (Solid, VerticalGradient, HorizontalGradient)
grid_color: Color32Grid line color
vertical_grid_color: Option<Color32>Vertical grid colour; None follows grid_color.
grid_line_style: LineStyleGrid line style, dotted by default.
vertical_grid_line_style: Option<LineStyle>Vertical grid line style; None follows grid_line_style.
text_color: Color32Text color for labels
axis_font_size: Option<f32>Font size of the price and time axis labels in logical pixels; None follows the theme.
Default: None
thousands_sep: Option<char>Character that groups the thousands of the built-in price labels: the ticks and tags of
price scales, the crosshair label and the legend’s prices write 42,541.77 with the
default ','. None writes plain digits (42541.77), and so do '.' and the ASCII
digits, since built-in labels always write '.' as the decimal point. Labels written by
a host formatter (Chart::set_price_formatter) are
never grouped; study panes, tooltips and volumes keep their own formats. Layouts saved
without this field restore with the default.
Default: Some(',')
candle_width: f32Width of candlestick/bar bodies as a fraction of available space (0.0 to 1.0)
wick_width: f32Stroke width for candlestick wicks
candle_border_width: f32Stroke width for candle borders (0 = no border)
show_grid: boolMaster visibility switch for horizontal and vertical grid lines
show_horizontal_grid: boolWhether to show horizontal grid lines
show_vertical_grid: boolWhether to show vertical grid lines
show_volume: boolWhether to show volume bars
volume_height_fraction: f32Volume height as a fraction of the price pane above volume_baseline_inset
volume_baseline_inset: f32Distance in points from the volume baseline to the price pane bottom (12 by default).
padding: f32Padding around the plot, excluding the axes and floating legend.
show_time_labels: boolWhether to show time labels on X-axis
show_ohlc_info: boolWhether to show OHLC info header
title_as_description: boolUse the host description rather than the ticker in the legend title.
show_quote_boxes: boolShow the current bid and ask controls in the legend.
show_ohlc_change: boolShow absolute bar change in the legend.
show_ohlc_change_percent: boolShow percentage bar change in the legend.
show_legend_volume: boolShow volume in the legend independently of the histogram.
show_indicator_inputs: boolShow host-supplied study inputs in the legend.
show_legend_badge: boolShow the symbol’s logo before the legend title: the legend badge, else the instrument’s logo, else the symbol’s initial on a neutral disc.
show_market_status: boolShow the market status after the legend title: the session’s state and delayed or end-of-day data.
show_last_day_change: boolShow the change of the last price from the previous session’s close in the legend.
indicator_backdrop_opacity: f32Opacity of the study rows’ backdrop, from 0 to 1.
show_currency: boolShow the host-supplied currency above the price ticks.
show_unit: boolShow the host-supplied price unit above the price ticks.
Show Auto, Log and Percent buttons in chart navigation.
Enable the crosshair price tag action that opens the host’s price menu.
show_extended_session_price: boolShow the host-supplied extended-session price tag independently of the last price.
extended_session_price_color: Color32Colour of the extended-session price tag.
show_right_axis: boolWhether to show right price axis
show_left_axis: boolWhether to show left price axis
right_axis_width: f32Minimum right price axis width in pixels; current labels can grow the column.
left_axis_width: f32Minimum left price axis width in pixels; current labels can grow the column.
price_axis: PriceAxisOptionsBorder, tick marks and label clipping of the price axis
right_axis_scale_mode: PriceScaleModeScale mode for right price axis (Normal, Logarithmic, Percentage, IndexedTo100)
left_axis_scale_mode: PriceScaleModeScale mode for left price axis (Normal, Logarithmic, Percentage, IndexedTo100)
show_symbol_labels: boolWhether to show symbol name labels
show_symbol_last_val: boolWhether to show last price value
show_price_line: boolDraw a line at the latest close independently of its tag.
show_prev_close_line: boolDraw a line at the preceding session close independently of its tag.
show_symbol_prev_close: boolWhether to show previous close value line
show_indicator_labels: boolWhether to show indicator name labels
show_indicator_last_val: boolWhether to show indicator last values
lock_price_to_bar_ratio: boolPreserve price units per bar when the time scale zooms or the pane resizes.
scale_price_chart_only: boolExclude overlay studies and their primitives from the main price scale’s autoscale range, without hiding them or changing their individual autoscale settings.
show_bid_ask: boolDraw the latest valid bid and ask lines and axis values supplied by the host.
show_high_low: boolDraw the highest high and lowest low of the visible bars on the price scale.
show_countdown: boolWhether to show countdown to next candle
show_realtime_btn: boolWhether to show the scroll-to-latest button when scrolled away from the live edge.
Position of the realtime button; bottom-right by default.
Custom text for the realtime button (None draws a double right chevron).
Size of the realtime button (width, height), 28 by 28 points by default.
Background color for the realtime button; PLACEHOLDER follows the theme.
Hover background color for the realtime button; PLACEHOLDER follows the theme.
Text or icon color for the realtime button; PLACEHOLDER follows the theme.
When to show the navigation buttons.
When to show the maximize and menu buttons of the panes.
show_session_breaks: boolWhether to show session break vertical lines
session_break_color: Color32Color for session break lines
session_break_style: LineStyleStyle for session break lines
session_config: Option<SessionConfig>Session configuration (market hours)
show_extended_hours: boolShade bars identified as extended hours by the session metadata.
extended_hours_color: Color32Extended-hours fill. PLACEHOLDER uses the active theme accent at low opacity.
show_watermark: boolWhether to show the symbol watermark.
watermark_text: Option<String>Text of the symbol watermark; \n starts another line. None shows the symbol and the
interval, such as AAPL, 1D, which follow symbol and interval changes.
watermark_description: boolWithout watermark_text, adds the instrument’s description on a second line. Absent in
configurations saved before it existed, where it reads as false.
watermark_color: Color32Watermark color (typically semi-transparent)
watermark_font_size: f32Font size of watermark_text. The symbol and interval line is twice this size and the
description line 11/12 of it.
watermark_pos: WatermarkPosWatermark position
skip_background: boolSkip background rendering (use when chart is inside a container with its own background)
Implementations§
Source§impl ChartConfig
impl ChartConfig
Sourcepub fn with_theme(self, theme: &Theme) -> Self
pub fn with_theme(self, theme: &Theme) -> Self
Apply the theme’s background, grid, axis text, candle, session break and watermark colours to this configuration.
Only the configuration changes. A chart paints its legend, quote boxes, labels and
overlays from its own theme, which ChartBuilder::with_theme
keeps for that chart, so switch a chart’s theme with
Chart::set_theme or
Chart::set_theme_override, which apply these
colours too.
Trait Implementations§
Source§impl Clone for ChartConfig
impl Clone for ChartConfig
Source§fn clone(&self) -> ChartConfig
fn clone(&self) -> ChartConfig
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 ChartConfig
impl Debug for ChartConfig
Source§impl Default for ChartConfig
impl Default for ChartConfig
Source§impl<'de> Deserialize<'de> for ChartConfig
impl<'de> Deserialize<'de> for ChartConfig
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 ChartConfig
impl PartialEq for ChartConfig
Source§impl Serialize for ChartConfig
impl Serialize for ChartConfig
impl StructuralPartialEq for ChartConfig
Auto Trait Implementations§
impl Freeze for ChartConfig
impl RefUnwindSafe for ChartConfig
impl Send for ChartConfig
impl Sync for ChartConfig
impl Unpin for ChartConfig
impl UnsafeUnpin for ChartConfig
impl UnwindSafe for ChartConfig
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