ChartExt

Trait ChartExt 

Source
pub(super) trait ChartExt {
    // Required methods
    fn with_defaults(title: &str) -> Self;
    fn with_axes(
        self,
        x_axis_label: &[String],
        x_axis_label_rotate: f64,
    ) -> Self;
    fn with_legend(self) -> Self;
    fn with_toolbox(self, features: Feature) -> Self;
    fn create_bar_chart(
        series: Vec<Bar>,
        x_axis_label: &[String],
        x_axis_label_rotate: f64,
        title: &str,
    ) -> Self
       where Self: Sized;
    fn create_line_chart(
        grouped_time_log: Vec<Line>,
        x_axis_label: &[String],
        x_axis_label_rotate: f64,
        title: &str,
    ) -> Self
       where Self: Sized;
    fn create_pie_chart(series: Pie, title: &str) -> Self
       where Self: Sized;
    fn render_svg(
        &self,
        width: u32,
        height: u32,
        custom_theme: Option<&str>,
    ) -> Result<String, ChartSettingError>;
    fn render_html(
        &self,
        width: u64,
        height: u64,
        custom_theme: Option<&str>,
    ) -> Result<String, ChartSettingError>;
}
Expand description

Extension methods for [charming::Chart]

Required Methods§

Source

fn with_defaults(title: &str) -> Self

Source

fn with_axes(self, x_axis_label: &[String], x_axis_label_rotate: f64) -> Self

Source

fn with_legend(self) -> Self

Source

fn with_toolbox(self, features: Feature) -> Self

Source

fn create_bar_chart( series: Vec<Bar>, x_axis_label: &[String], x_axis_label_rotate: f64, title: &str, ) -> Self
where Self: Sized,

Source

fn create_line_chart( grouped_time_log: Vec<Line>, x_axis_label: &[String], x_axis_label_rotate: f64, title: &str, ) -> Self
where Self: Sized,

Source

fn create_pie_chart(series: Pie, title: &str) -> Self
where Self: Sized,

Source

fn render_svg( &self, width: u32, height: u32, custom_theme: Option<&str>, ) -> Result<String, ChartSettingError>

Source

fn render_html( &self, width: u64, height: u64, custom_theme: Option<&str>, ) -> Result<String, ChartSettingError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ChartExt for Chart

Source§

fn with_defaults(title: &str) -> Chart

Creates a new chart with default settings

Source§

fn with_axes(self, x_axis_label: &[String], x_axis_label_rotate: f64) -> Self

Adds x and y-axis to the chart.

Source§

fn with_legend(self) -> Self

Adds a legend to the chart.

Source§

fn with_toolbox(self, feature: Feature) -> Self

Adds a toolbox with the specified features to the chart.

Source§

fn create_bar_chart( series: Vec<Bar>, x_axis_label: &[String], x_axis_label_rotate: f64, title: &str, ) -> Self

Creates a new bar chart with the given series, x-axis label, x-axis rotation value and title.

Source§

fn create_line_chart( lines: Vec<Line>, x_axis_label: &[String], x_axis_label_rotate: f64, title: &str, ) -> Self

Creates a new line chart with the given series, x-axis label, x-axis rotation value and title.

Source§

fn create_pie_chart(series: Pie, title: &str) -> Self

Creates a new pie chart with the given series and the title.

Source§

fn render_svg( &self, width: u32, height: u32, custom_theme: Option<&str>, ) -> Result<String, ChartSettingError>

Renders the chart into an SVG with the theme. If custom_theme is None, [Theme::Default] is used.

Source§

fn render_html( &self, width: u64, height: u64, custom_theme: Option<&str>, ) -> Result<String, ChartSettingError>

Renders the chart into an HTTP with the theme. If custom_theme is None, [Theme::Default] is used.

Implementors§