Struct textplots::Chart

source ·
pub struct Chart<'a> { /* private fields */ }
Expand description

Controls the drawing.

Implementations§

source§

impl<'a> Chart<'a>

source

pub fn new(width: u32, height: u32, xmin: f32, xmax: f32) -> Self

Creates a new Chart object.

§Panics

Panics if width is less than 32 or height is less than 3.

source

pub fn new_with_y_range( width: u32, height: u32, xmin: f32, xmax: f32, ymin: f32, ymax: f32 ) -> Self

Creates a new Chart object with fixed y axis range.

§Panics

Panics if width is less than 32 or height is less than 3.

source

pub fn display(&mut self)

Prints canvas content.

source

pub fn nice(&mut self)

Prints canvas content with some additional visual elements (like borders).

source

pub fn axis(&mut self)

Shows axis.

source

pub fn x_axis(&mut self)

Shows x-axis.

source

pub fn y_axis(&mut self)

Shows y-axis.

source

pub fn figures(&mut self)

source

pub fn frame(&self) -> String

Returns the frame.

Trait Implementations§

source§

impl<'a> AxisBuilder<'a> for Chart<'a>

source§

fn x_axis_style(&'a mut self, style: LineStyle) -> &'a mut Chart<'_>

Specifies the style of x-axis.
source§

fn y_axis_style(&'a mut self, style: LineStyle) -> &'a mut Chart<'_>

Specifies the style of y-axis.
source§

impl<'a> ColorPlot<'a> for Chart<'a>

source§

fn linecolorplot( &'a mut self, shape: &'a Shape<'_>, color: RGB8 ) -> &'a mut Chart<'_>

Draws a line chart of points connected by straight line segments using the specified color
source§

impl<'a> Default for Chart<'a>

source§

fn default() -> Self

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

impl<'a> Display for Chart<'a>

source§

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

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

impl<'a> LabelBuilder<'a> for Chart<'a>

source§

fn x_label_format(&mut self, format: LabelFormat) -> &mut Self

Specifies a formater for the x-axis label.

source§

fn y_label_format(&mut self, format: LabelFormat) -> &mut Self

Specifies a formater for the y-axis label.

source§

impl<'a> Plot<'a> for Chart<'a>

source§

fn lineplot(&'a mut self, shape: &'a Shape<'_>) -> &'a mut Chart<'_>

Draws a line chart of points connected by straight line segments.
source§

impl<'a> TickDisplayBuilder<'a> for Chart<'a>

source§

fn y_tick_display(&mut self, density: TickDisplay) -> &mut Self

Specifies the density of y-axis tick labels

Auto Trait Implementations§

§

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

§

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

§

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

§

impl<'a> Unpin for Chart<'a>

§

impl<'a> !UnwindSafe for Chart<'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> 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.