Struct lc_render::chart::Chart[][src]

pub struct Chart<'a> { /* fields omitted */ }
Expand description

Chart represents a single document with one or more views, axes and a title. It will also contain grid and legend in the future.

Implementations

impl<'a> Chart<'a>[src]

pub fn new() -> Self[src]

Create a new chart.

pub fn view_width(&self) -> i32[src]

Get chart width that can be used for views.

pub fn view_height(&self) -> i32[src]

Get chart height that can be used for views.

pub fn set_margin_top(self, margin_top: i32) -> Self[src]

Set chart top margin.

pub fn set_margin_bottom(self, margin_bottom: i32) -> Self[src]

Set chart bottom margin.

pub fn set_margin_left(self, margin_left: i32) -> Self[src]

Set chart left margin.

pub fn set_margin_right(self, margin_right: i32) -> Self[src]

Set chart right margin.

pub fn set_width(self, width: i32) -> Self[src]

Set chart width.

pub fn set_height(self, height: i32) -> Self[src]

Set chart height.

pub fn set_axis_top_band(self, scale: BandScale) -> Self[src]

Set BandScale for top axis.

pub fn set_axis_top_linear(self, scale: LinearScale) -> Self[src]

Set LinearScale for top axis.

pub fn set_axis_bottom_band(self, scale: BandScale) -> Self[src]

Set BandScale for bottom axis.

pub fn set_axis_bottom_linear(self, scale: LinearScale) -> Self[src]

Set LinearScale for bottom axis.

pub fn set_axis_left_band(self, scale: BandScale) -> Self[src]

Set BandScale for left axis.

pub fn set_axis_left_linear(self, scale: LinearScale) -> Self[src]

Set LinearScale for left axis.

pub fn set_axis_right_band(self, scale: BandScale) -> Self[src]

Set BandScale for right axis.

pub fn set_axis_right_linear(self, scale: LinearScale) -> Self[src]

Set LinearScale for right axis.

pub fn set_axis_top_label(self, label: &str) -> Self[src]

Set label for top axis.

pub fn set_axis_bottom_label(self, label: &str) -> Self[src]

Set label for bottom axis.

pub fn set_axis_left_label(self, label: &str) -> Self[src]

Set label for left axis.

pub fn set_axis_right_label(self, label: &str) -> Self[src]

Set label for right axis.

pub fn set_title(self, title: &str) -> Self[src]

Set chart title.

pub fn add_view(self, view: &'a dyn View) -> Self[src]

Add a view to chart.

pub fn set_views(self, views: Vec<&'a dyn View>) -> Self[src]

Set chart views.

pub fn to_svg(&self) -> Document[src]

Get chart SVG representation.

pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>[src]

Save chart to SVG file at the specified path.

Trait Implementations

impl<'a> Default for Chart<'a>[src]

fn default() -> Self[src]

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.