Struct rustplot::chart_builder::AxisProp
[−]
[src]
pub struct AxisProp { /* fields omitted */ }
Structure allowing manipulation of chart axis.
Methods
impl AxisProp
[src]
pub fn set_x_axis_bounds(&mut self, min: f64, max: f64)
[src]
Sets the upper and lower bounds (maximum and minimum value) of the x-axis. After new bounds are selected, a new scale is auto calcuated.
min
is the low bound (minimum value) on the x-axis.
max
is the upper bound (maximum value) on the x-axis.
Defaults are intelligently selected with use of the data provided. Any changes made to a categorical axis (e.g. bar chart) will have no effect.
Examples
use rustplot::chart_builder; // Create instance of pie chart. let mut xy_scatter_plot = chart_builder::XYScatterPlot::new(String::from("SCATTER CHART"), vec![vec![30.0, 50.0, 80.0]], vec![vec![35.0, 45.0, 70.0]]); // Set axis bounds. xy_scatter_plot.axis_prop.set_x_axis_bounds(100.0, 300.0);
pub fn set_y_axis_bounds(&mut self, min: f64, max: f64)
[src]
Sets the upper and lower bounds (maximum and minimum value) of the y-axis. After new bounds are selected, a new scale is auto calcuated.
min
is the low bound (minimum value) on the y-axis.
max
is the upper bound (maximum value) on the y-axis.
Defaults are intelligently selected with use of the data provided. Any changes made to a histogram will have no effect as frequencies are calculated during drawing.
Examples
use rustplot::chart_builder; // Create instance of pie chart. let mut xy_scatter_plot = chart_builder::XYScatterPlot::new(String::from("SCATTER CHART"), vec![vec![30.0, 50.0, 80.0]], vec![vec![35.0, 45.0, 70.0]]); // Set axis bounds. xy_scatter_plot.axis_prop.set_x_axis_bounds(100.0, 300.0);
pub fn set_x_axis_interval(&mut self, new_interval: f64)
[src]
Sets the (scale) interval for numbered delimiters shown on the x-axis.
new_interval
interval set bewteen each numbered delimiter on axis.
Defaults are intelligently selected with use of the data provided. It is important to use this after calling set_x_axis_bounds() as this will recalculate the scale.
pub fn set_y_axis_interval(&mut self, new_interval: f64)
[src]
Sets the (scale) interval for numbered delimiters shown on the y-axis.
new_interval
interval set bewteen each numbered delimiter on axis.
Defaults are intelligently selected with use of the data provided. It is important to use this after calling set_y_axis_bounds() as this will recalculate the scale.
pub fn set_x_axis_title(&mut self, new_title: String)
[src]
Sets x-axis title.
new_title
the String to be displayed on the x-axis.
pub fn set_y_axis_title(&mut self, new_title: String)
[src]
Sets y-axis title.
new_title
the String to be displayed on the y-axis.