[][src]Struct charts::Chart

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

The Chart struct definition. A Chart is the smallest entity that can be saved (the bigger one is a Page (TBD)).

Methods

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

pub fn new() -> Self[src]

Create a new instance of a chart with default sizes.

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

Set chart width.

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

Set chart height.

pub fn add_title(self, title: String) -> Self[src]

Add chart title.

pub fn set_margins(
    self,
    top: isize,
    right: isize,
    bottom: isize,
    left: isize
) -> Self
[src]

Set the margins of the chart to provided values.

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

Add the dataset to the chart's view.

pub fn add_axis_bottom<T: ToString>(self, scale: &'a dyn Scale<T>) -> Self[src]

Add an axis at the bottom of the chart.

pub fn add_axis_left<T: ToString>(self, scale: &'a dyn Scale<T>) -> Self[src]

Add an axis at the left of the chart.

pub fn add_axis_top<T: ToString>(self, scale: &'a dyn Scale<T>) -> Self[src]

Add an axis at the top of the chart.

pub fn add_axis_right<T: ToString>(self, scale: &'a dyn Scale<T>) -> Self[src]

Add an axis at the right of the chart.

pub fn add_right_axis_label<T: ToString>(self, label: T) -> Self[src]

Add a label for the right of the chart.

pub fn add_left_axis_label<T: ToString>(self, label: T) -> Self[src]

Add a label for the left of the chart.

pub fn add_top_axis_label<T: ToString>(self, label: T) -> Self[src]

Add a label for the top of the chart.

pub fn add_bottom_axis_label<T: ToString>(self, label: T) -> Self[src]

Add a label for the bottom of the chart.

pub fn get_view_horizontal_start_offset(&self) -> isize[src]

Return the offset from the left where the view starts.

pub fn get_view_horizontal_end_offset(&self) -> isize[src]

Return the offset from the left where the view ends.

pub fn get_view_vertical_start_offset(&self) -> isize[src]

Return the offset from the left where the view starts.

pub fn get_view_vertical_end_offset(&self) -> isize[src]

Return the offset from the left where the view ends.

pub fn get_view_width(&self) -> isize[src]

Return the width of the view.

pub fn get_chart_width(&self) -> isize[src]

Return the width of the chart.

pub fn get_chart_height(&self) -> isize[src]

Return the height of the chart.

pub fn get_view_height(&self) -> isize[src]

Return the height of the view.

pub fn add_legend_at(self, position: AxisPosition) -> Self[src]

Set legend position at the specified side of the chart.

pub fn set_bottom_axis_tick_label_rotation(self, rotation: isize) -> Self[src]

Set the rotation in degrees of the bottom axis tick labels.

pub fn set_top_axis_tick_label_rotation(self, rotation: isize) -> Self[src]

Set the rotation in degrees of the top axis tick labels.

pub fn set_left_axis_tick_label_rotation(self, rotation: isize) -> Self[src]

Set the rotation in degrees of the left axis tick labels.

pub fn set_right_axis_tick_label_rotation(self, rotation: isize) -> Self[src]

Set the rotation in degrees of the right axis tick labels.

pub fn set_left_axis_tick_label_format(self, format: &str) -> Self[src]

Set the format type of labels on the left axis.

pub fn set_right_axis_tick_label_format(self, format: &str) -> Self[src]

Set the format type of labels on the right axis.

pub fn set_top_axis_tick_label_format(self, format: &str) -> Self[src]

Set the format type of labels on the top axis.

pub fn set_bottom_axis_tick_label_format(self, format: &str) -> Self[src]

Set the format type of labels on the bottom axis.

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

Save the chart to a file

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]

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

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

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

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

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.

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.