Struct charts_rs::Canvas

source ·
pub struct Canvas {
    pub width: f32,
    pub height: f32,
    pub components: Rc<RefCell<Vec<Component>>>,
    pub margin: Box,
}

Fields§

§width: f32§height: f32§components: Rc<RefCell<Vec<Component>>>§margin: Box

Implementations§

source§

impl Canvas

source

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

source

pub fn width(&self) -> f32

source

pub fn height(&self) -> f32

source

pub fn child(&self, margin: Box) -> Self

source

pub fn line(&mut self, line: Line) -> Box

source

pub fn rect(&mut self, rect: Rect) -> Box

source

pub fn polyline(&mut self, polyline: Polyline) -> Box

source

pub fn circle(&mut self, circle: Circle) -> Box

source

pub fn polygon(&mut self, polygon: Polygon) -> Box

source

pub fn text(&mut self, text: Text) -> Box

source

pub fn pie(&mut self, pie: Pie) -> Box

source

pub fn smooth_line(&mut self, line: SmoothLine) -> Box

source

pub fn straight_line(&mut self, line: StraightLine) -> Box

source

pub fn smooth_line_fill(&mut self, fill: SmoothLineFill) -> Box

source

pub fn straight_line_fill(&mut self, fill: StraightLineFill) -> Box

source

pub fn grid(&mut self, grip: Grid) -> Box

source

pub fn axis(&mut self, axis: Axis) -> Box

source

pub fn legend(&mut self, legend: Legend) -> Box

source

pub fn append(&mut self, component: Component)

source

pub fn svg(&self) -> Result<String, Error>

Auto Trait Implementations§

§

impl !RefUnwindSafe for Canvas

§

impl !Send for Canvas

§

impl !Sync for Canvas

§

impl Unpin for Canvas

§

impl !UnwindSafe for Canvas

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.