pub struct Watermark {
pub lines: Vec<WatermarkLine>,
pub image: Option<Image<'static>>,
pub align: Align2,
pub padding: f32,
}Expand description
An image and lines of text painted behind the series, stacked in that order and aligned
together in the price pane; see Chart::set_watermark.
Fields§
§lines: Vec<WatermarkLine>Lines of text, top to bottom.
image: Option<Image<'static>>Image above the lines. By default it is scaled to fit the pane less the padding,
keeping its aspect ratio; [egui::Image::max_size] limits it and
[egui::Image::tint] makes it translucent.
align: Align2Where the image and the lines sit in the pane, and how the lines align with each
other. Default [Align2::CENTER_CENTER].
padding: f32Distance from the pane’s edges in points. Default 0.
Implementations§
Source§impl Watermark
impl Watermark
Sourcepub fn with_line(self, line: WatermarkLine) -> Self
pub fn with_line(self, line: WatermarkLine) -> Self
Adds a line below the others.
Sourcepub fn with_image(self, image: Image<'static>) -> Self
pub fn with_image(self, image: Image<'static>) -> Self
Sets the image.
Sourcepub fn with_align(self, align: Align2) -> Self
pub fn with_align(self, align: Align2) -> Self
Sets the alignment.
Sourcepub fn with_padding(self, padding: f32) -> Self
pub fn with_padding(self, padding: f32) -> Self
Sets the distance from the pane’s edges.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Watermark
impl RefUnwindSafe for Watermark
impl Send for Watermark
impl Sync for Watermark
impl Unpin for Watermark
impl UnsafeUnpin for Watermark
impl UnwindSafe for Watermark
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,
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