Struct rustplot::chart_builder::ChartProp [] [src]

pub struct ChartProp { /* fields omitted */ }

Structure allowing manipulation of functionality common to all charts.

Methods

impl ChartProp
[src]

[src]

Sets screen size of chart BEFORE the portion of the screen for legend is added.

width is a f64 number specifying the horizontal size.

height is a f64 number specifying the vertical size.

Defaults for both width and height vary from 700-800 depending on data input.

[src]

Sets strings that will be displayed in legend (empty by default).

new_legend_values is a Vec containing the desired strings to be displayed in the legend.

[src]

Sets whether a legend will be displayed (false by default).

new_show_legend is a boolean value, set to true to show legend and false to hide.

Examples

use rustplot::chart_builder;
use rustplot::chart_builder::Chart;

// Create instance of pie chart.
let mut pie_chart = chart_builder::PieChart::new(String::from("PIE CHART"), vec![30.0, 50.0, 80.0]);

// Create a Vec<String> with names of series to be placed in legend.
let legend_values = vec![String::from("Series 1"), String::from("Series 2"), String::from("Series 3")];
// Set legend values.
pie_chart.chart_prop.set_legend_values(legend_values);
// Set legend to be shown.
pie_chart.chart_prop.set_show_legend(true);

// Draw the pie chart displaying legend.
pie_chart.draw();

Trait Implementations

impl Clone for ChartProp
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for ChartProp

impl Sync for ChartProp