Struct rustplot::chart_builder::ChartProp
[−]
[src]
pub struct ChartProp { /* fields omitted */ }
Structure allowing manipulation of functionality common to all charts.
Methods
impl ChartProp
[src]
pub fn set_screen_size(&mut self, width: f64, height: f64)
[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.
pub fn set_legend_values(&mut self, new_legend_values: Vec<String>)
[src]
Sets strings that will be displayed in legend (empty by default).
new_legend_values
is a Vec
pub fn set_show_legend(&mut self, new_show_legend: bool)
[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();