pub struct Marker {
pub time: Timestamp,
pub position: MarkerPosition,
pub shape: MarkerShape,
pub color: Option<Rgba>,
pub text: String,
}Expand description
An icon with optional text above or below a bar, e.g. a buy or sell signal. Anchored by time; markers on the same bar and side stack away from it in the order given.
§Examples
use ferrochart_core::chart::{Marker, MarkerPosition, MarkerShape, SeriesOptions};
use ferrochart_core::frame::SeriesKind;
use ferrochart_core::{Chart, ChartOptions};
let mut chart = Chart::new(ChartOptions::default());
let id = chart.add_series(chart.main_pane(), SeriesKind::Candlestick, SeriesOptions::default())?;
chart.set_markers(id, vec![Marker {
time: 1_700_000_000_000,
position: MarkerPosition::BelowBar,
shape: MarkerShape::ArrowUp,
text: "buy".into(),
..Marker::default()
}])?;
assert_eq!(chart.markers(id).map(<[Marker]>::len), Some(1));Fields§
§time: TimestampTime of the bar. A time that is not on the time axis snaps to the next bar (the last one for times after the end).
position: MarkerPositionAbove or below the bar.
shape: MarkerShapeIcon.
color: Option<Rgba>Icon and text color; None uses the series’ main color.
text: StringText next to the icon, on the side away from the bar; empty for none.
Trait Implementations§
impl StructuralPartialEq for Marker
Auto Trait Implementations§
impl Forget for Marker
impl Freeze for Marker
impl Move for Marker
impl RefUnwindSafe for Marker
impl Send for Marker
impl Sync for Marker
impl Unpin for Marker
impl UnsafeUnpin for Marker
impl UnwindSafe for Marker
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
Mutably borrows from an owned value. Read more