pub struct Marker {
pub time: DateTime<Utc>,
pub position: MarkerPos,
pub shape: MarkerShape,
pub color: Color32,
pub text: Option<String>,
pub tooltip: Option<String>,
pub size: f32,
pub id: Option<String>,
pub price: Option<f64>,
}Expand description
Marker for chart annotations
Fields§
§time: DateTime<Utc>Time of the marker (matches a data point)
position: MarkerPosPos relative to the bar
shape: MarkerShapeShape of the marker
color: Color32Color of the marker; PLACEHOLDER, the default of Marker::new, uses the theme’s text
colour.
text: Option<String>Optional text label
tooltip: Option<String>Optional tooltip (shown on hover)
size: f32Size multiplier (1.0 = normal size)
id: Option<String>Unique ID for the marker (for removal/editing)
price: Option<f64>Price of the AtPrice positions, in the series’ units; without one they use the close.
Implementations§
Source§impl Marker
impl Marker
Sourcepub fn with_shape(self, shape: MarkerShape) -> Self
pub fn with_shape(self, shape: MarkerShape) -> Self
Set the shape
Sourcepub fn with_color(self, color: Color32) -> Self
pub fn with_color(self, color: Color32) -> Self
Set the color
Sourcepub fn with_tooltip(self, tooltip: impl Into<String>) -> Self
pub fn with_tooltip(self, tooltip: impl Into<String>) -> Self
Set the tooltip
Sourcepub fn at_price(self, price: f64, position: MarkerPos) -> Self
pub fn at_price(self, price: f64, position: MarkerPos) -> Self
Anchors the marker to price at position, one of the AtPrice positions.
Sourcepub fn buy_signal(time: DateTime<Utc>) -> Self
pub fn buy_signal(time: DateTime<Utc>) -> Self
Quick constructor for a buy signal marker (green arrow up)
Sourcepub fn sell_signal(time: DateTime<Utc>) -> Self
pub fn sell_signal(time: DateTime<Utc>) -> Self
Quick constructor for a sell signal marker (red arrow down)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Marker
impl<'de> Deserialize<'de> for Marker
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze 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
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> ⓘ
Converts
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> ⓘ
Converts
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