pub struct BasicPlot {
pub lines: Vec<Line>,
pub name: Arc<String>,
pub x_axis: Axis,
pub y_axis_left: Axis,
pub y_axis_right: Option<Axis>,
pub interaction: PlotInteraction,
pub title: Option<String>,
pub rotate_line_highlights: bool,
pub line_highlight_focus_duration: Duration,
/* private fields */
}
Expand description
Basic plot, with ability to switch between linear and log axes. This widget tracks state and is meant to be saved across multiple frames.
Fields§
§lines: Vec<Line>
The data to plot each frame.
name: Arc<String>
§x_axis: Axis
The X-axis settings
y_axis_left: Axis
The Y-axis settings
y_axis_right: Option<Axis>
§interaction: PlotInteraction
The Interaction tracking of the plot
title: Option<String>
Optional title for this plot.
rotate_line_highlights: bool
§line_highlight_focus_duration: Duration
Implementations§
Source§impl BasicPlot
impl BasicPlot
pub fn new(ctx: &Context) -> BasicPlot
pub fn with_title<T: AsRef<str>>(self, title: T) -> Self
pub fn with_x_axis_label<T: AsRef<str>>(self, title: T) -> Self
pub fn with_y_axis_label<T: AsRef<str>>(self, title: T) -> Self
pub fn with_x_axis_formatter(self, fmtr: Box<FormatterFn>) -> Self
pub fn with_y_axis_formatter(self, fmtr: Box<FormatterFn>) -> Self
pub fn add_line<T: FnMut(&mut Line)>(&mut self, func: T) -> LineDataExchanger
pub fn add_line_with_error_bars<T: FnMut(&mut Line)>( &mut self, func: T, ) -> (LineDataExchanger, ErrorBarsExchanger)
pub fn show(&mut self, ui: &mut Ui)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BasicPlot
impl !RefUnwindSafe for BasicPlot
impl Send for BasicPlot
impl !Sync for BasicPlot
impl Unpin for BasicPlot
impl !UnwindSafe for BasicPlot
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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