pub struct IndicatorPane { /* private fields */ }Expand description
A separate-pane indicator panel rendered via direct egui painting.
Each IndicatorPane renders one indicator (RSI, MACD, etc.) in its own
rectangular area below the main chart. The pane includes:
- Indicator line(s) with proper colors
- Horizontal zone lines (e.g., RSI 70/30 overbought/oversold)
- Semi-transparent zone fills for overbought/oversold regions
- Y-axis labels on the right side
- A legend showing the indicator name and current value
- Optional vertical grid lines aligned with the main chart
Implementations§
Source§impl IndicatorPane
impl IndicatorPane
Sourcepub fn with_config(config: IndicatorPaneConfig) -> Self
pub fn with_config(config: IndicatorPaneConfig) -> Self
Create a new indicator panel with custom configuration
Sourcepub fn show(
&mut self,
ui: &mut Ui,
indicator: &dyn Indicator,
bars: &[Bar],
visible_range: Range<usize>,
)
pub fn show( &mut self, ui: &mut Ui, indicator: &dyn Indicator, bars: &[Bar], visible_range: Range<usize>, )
Render the indicator panel with proper x-axis alignment
Sourcepub fn show_aligned(
&mut self,
ui: &mut Ui,
indicator: &dyn Indicator,
bars: &[Bar],
_visible_range: Range<usize>,
coords: IndicatorCoordParams,
)
pub fn show_aligned( &mut self, ui: &mut Ui, indicator: &dyn Indicator, bars: &[Bar], _visible_range: Range<usize>, coords: IndicatorCoordParams, )
Render with explicit coordinate parameters for perfect x-axis alignment.
Uses IndicatorCoordParams from the main chart to ensure that each
indicator data point is drawn at the exact same x-coordinate as its
corresponding bar in the price chart above.
Sourcepub fn show_aligned_interactive(
&mut self,
ui: &mut Ui,
indicator: &dyn Indicator,
bars: &[Bar],
_visible_range: Range<usize>,
coords: IndicatorCoordParams,
) -> Option<PaneInteraction>
pub fn show_aligned_interactive( &mut self, ui: &mut Ui, indicator: &dyn Indicator, bars: &[Bar], _visible_range: Range<usize>, coords: IndicatorCoordParams, ) -> Option<PaneInteraction>
Render with coordinate alignment and return layout info for hit testing.
Like IndicatorPane::show_aligned, but returns the panel and chart
rects, y-axis range, and an interactive [egui::Response]. This allows
the caller to implement click-on-line selection, tooltip display, or
other interactive features on indicator panes.
Returns None if the indicator is not visible.
The returned PaneInteraction also carries the [egui::Response] for the
legend’s close “x” (when the pane shows a legend), so the host can offer
one-click pane removal.
Auto Trait Implementations§
impl !RefUnwindSafe for IndicatorPane
impl !UnwindSafe for IndicatorPane
impl Freeze for IndicatorPane
impl Send for IndicatorPane
impl Sync for IndicatorPane
impl Unpin for IndicatorPane
impl UnsafeUnpin for IndicatorPane
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