Struct egui_plot::BoxPlot

source ·
pub struct BoxPlot { /* private fields */ }
Expand description

A diagram containing a series of BoxElem elements.

Implementations§

source§

impl BoxPlot

source

pub fn new(boxes: Vec<BoxElem>) -> Self

Create a plot containing multiple boxes. It defaults to vertically oriented elements.

source

pub fn color(self, color: impl Into<Color32>) -> Self

Set the default color. It is set on all elements that do not already have a specific color. This is the color that shows up in the legend. It can be overridden at the element level (see BoxElem). Default is Color32::TRANSPARENT which means a color will be auto-assigned.

source

pub fn name(self, name: impl ToString) -> Self

Name of this box plot diagram.

This name will show up in the plot legend, if legends are turned on. Multiple series may share the same name, in which case they will also share an entry in the legend.

source

pub fn vertical(self) -> Self

Set all elements to be in a vertical orientation. Argument axis will be X and values will be on the Y axis.

source

pub fn horizontal(self) -> Self

Set all elements to be in a horizontal orientation. Argument axis will be Y and values will be on the X axis.

source

pub fn highlight(self, highlight: bool) -> Self

Highlight all plot elements.

source

pub fn element_formatter( self, formatter: Box<dyn Fn(&BoxElem, &Self) -> String> ) -> Self

Add a custom way to format an element. Can be used to display a set number of decimals or custom labels.

source

pub fn id(self, id: Id) -> Self

Set the box plot’s id which is used to identify it in the plot’s response.

Trait Implementations§

source§

impl PlotItem for BoxPlot

source§

fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>)

source§

fn initialize(&mut self, _x_range: RangeInclusive<f64>)

For plot-items which are generated based on x values (plotting functions).
source§

fn name(&self) -> &str

source§

fn color(&self) -> Color32

source§

fn highlight(&mut self)

source§

fn highlighted(&self) -> bool

source§

fn geometry(&self) -> PlotGeometry<'_>

source§

fn bounds(&self) -> PlotBounds

source§

fn find_closest( &self, point: Pos2, transform: &PlotTransform ) -> Option<ClosestElem>

source§

fn on_hover( &self, elem: ClosestElem, shapes: &mut Vec<Shape>, cursors: &mut Vec<Cursor>, plot: &PlotConfig<'_>, _: &LabelFormatter )

source§

fn id(&self) -> Option<Id>

Auto Trait Implementations§

§

impl Freeze for BoxPlot

§

impl !RefUnwindSafe for BoxPlot

§

impl !Send for BoxPlot

§

impl !Sync for BoxPlot

§

impl Unpin for BoxPlot

§

impl !UnwindSafe for BoxPlot

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.