Struct ChartLayout

Source
pub struct ChartLayout<'a> { /* private fields */ }
Expand description

Specifies layout of chart before creating DrawingArea

Implementations§

Source§

impl<'a> ChartLayout<'a>

Source

pub fn new() -> Self

Source

pub fn set_all_label_area_size( &mut self, top: u32, bottom: u32, left: u32, right: u32, ) -> &mut Self

Source

pub fn x_label_area_size(&mut self, size: u32) -> &mut Self

Source

pub fn y_label_area_size(&mut self, size: u32) -> &mut Self

Source

pub fn top_x_label_area_size(&mut self, size: u32) -> &mut Self

Source

pub fn right_y_label_area_size(&mut self, size: u32) -> &mut Self

Source

pub fn set_all_margin( &mut self, top: u32, bottom: u32, left: u32, right: u32, ) -> &mut Self

Source

pub fn margin(&mut self, size: u32) -> &mut Self

Source

pub fn margin_top(&mut self, size: u32) -> &mut Self

Source

pub fn margin_bottom(&mut self, size: u32) -> &mut Self

Source

pub fn margin_left(&mut self, size: u32) -> &mut Self

Source

pub fn margin_right(&mut self, size: u32) -> &mut Self

Source

pub fn no_caption(&mut self) -> &mut Self

Source

pub fn caption( &mut self, text: impl Into<String>, font: impl Into<FontDesc<'a>>, ) -> Result<&mut Self, FontError>

Sets new caption text and calculates caption area above the chart.

Source

pub fn replace_caption(&mut self, text: impl Into<String>) -> &mut Self

Replaces caption test, without updating layout.

It is needed to call caption() in order to make caption visible.

Source

pub fn desired_image_size(&self, plot_size: (u32, u32)) -> (u32, u32)

Size of root area whose plotting area will be equal to plot_size.

An DrawingArea with returned size should be given for bind().

Source

pub fn desired_image_height_from_width( &self, image_width: u32, aspect_ratio: f64, ) -> u32

Estimates required root-area height from its width and the aspect ratio of the plotting area.

aspect_ratio is the ratio of plotting-area height to its width.

Source

pub fn bind<'b, DB>( &self, root_area: &'b DrawingArea<DB, Shift>, ) -> Result<ChartLayoutBuilder<'b, DB>, DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>>
where DB: DrawingBackend, 'a: 'b,

Bind layout information to an actual root area.

Trait Implementations§

Source§

impl<'a> Clone for ChartLayout<'a>

Source§

fn clone(&self) -> ChartLayout<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ChartLayout<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for ChartLayout<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ChartLayout<'a>

§

impl<'a> !RefUnwindSafe for ChartLayout<'a>

§

impl<'a> !Send for ChartLayout<'a>

§

impl<'a> !Sync for ChartLayout<'a>

§

impl<'a> Unpin for ChartLayout<'a>

§

impl<'a> !UnwindSafe for ChartLayout<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

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.