Skip to main content

TernaryChartBuilder

Struct TernaryChartBuilder 

Source
pub struct TernaryChartBuilder<'root, DB: DrawingBackend> { /* private fields */ }
Expand description

Builder for an owned, Cartesian-backed TernaryChart.

The implicit viewport is resolved at build time from the current geometry. Once TernaryChartBuilder::viewport is called, later geometry changes do not replace that explicit viewport.

Implementations§

Source§

impl<'root, DB: DrawingBackend> TernaryChartBuilder<'root, DB>

Source

pub fn on(root: &'root DrawingArea<DB, Shift>) -> Self

Begin a ternary chart in a Plotters root drawing area.

Source

pub const fn geometry(self, geometry: TernaryGeometry) -> Self

Set the triangle geometry.

An implicit full viewport follows this geometry at build time. An explicitly selected viewport is preserved.

Source

pub const fn viewport(self, viewport: TernaryViewport) -> Self

Select an explicit logical clipping viewport.

Source

pub const fn viewport_fit(self, fit: ViewportFit) -> Self

Select aspect preservation or explicit stretching.

Source

pub const fn viewport_alignment(self, alignment: ViewportAlignment) -> Self

Align an aspect-fitted plotting subarea.

Source

pub fn caption<S, Style>(self, caption: S, style: Style) -> Self
where S: AsRef<str>, Style: IntoTextStyle<'root>,

Add a Plotters-rendered caption outside the fitted ternary viewport.

Source

pub const fn margin(self, margin: u32) -> Self

Set equal outer margins in backend pixels.

Source

pub fn build<'chart>( self, ) -> Result<TernaryChart<'chart, DB>, TernaryChartError<DB::ErrorType>>
where DB: 'chart,

Build the owned Cartesian chart on an aspect-fitted Plotters subarea.

Auto Trait Implementations§

§

impl<'root, DB> !RefUnwindSafe for TernaryChartBuilder<'root, DB>

§

impl<'root, DB> !Send for TernaryChartBuilder<'root, DB>

§

impl<'root, DB> !Sync for TernaryChartBuilder<'root, DB>

§

impl<'root, DB> !UnwindSafe for TernaryChartBuilder<'root, DB>

§

impl<'root, DB> Freeze for TernaryChartBuilder<'root, DB>
where &'root DrawingArea<DB, Shift>: Freeze,

§

impl<'root, DB> Unpin for TernaryChartBuilder<'root, DB>
where &'root DrawingArea<DB, Shift>: Unpin,

§

impl<'root, DB> UnsafeUnpin for TernaryChartBuilder<'root, DB>
where &'root DrawingArea<DB, Shift>: UnsafeUnpin,

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.