Module rustplot::chart_builder
[−]
[src]
This module provides all functionality for creating and drawing customizable charts.
Each chart that can drawn has its own structure which can be created with data provided to it and a name.
All charts can be drawn using the draw() method provided by the Chart trait that each chart implements.
All charts are composed of the ChartProp structure allowing manipulation of functionality common to all charts.
Charts that require axis are composed of the AxisProp structure allowing manipulation of axis.
Example of General Use
// Imports for libary use. use rustplot::chart_builder; use rustplot::chart_builder::Chart; // Data used to build chart (data_parser can be used to fetch this data from a csv file). let x_data = vec![vec![38.0, 67.0, 80.0], // x data of first series vec![29.0, 48.0, 94.0]]; // x data of second series let y_data = vec![vec![27.0, 50.0, 80.0], // y data of first series vec![45.0, 55.0, 78.0]]; // y data of second series let mag_data = vec![vec![2.0, 8.0, 15.0], // magnitude data of first series vec![6.0, 10.0, 18.0]]; // magnitude data of second series // Create instance of a chart with data. let mut example_chart = chart_builder::BubbleChart::new(String::from("Example Bubble Chart"), x_data, y_data, mag_data ); // Add legend data and show ledgend (optional) let legend_values = vec![String::from("Series 1"), String::from("Series 2")]; example_chart.chart_prop.set_legend_values(legend_values); example_chart.chart_prop.set_show_legend(true); // Draw the chart displayed in a window. example_chart.draw();
Structs
AreaChart |
Structure used for storing chart related data and the drawing of an Area Chart. |
AxisProp |
Structure allowing manipulation of chart axis. |
BoxWhiskerPlot |
Structure used for storing chart related data and the drawing of a Box and Whisker Plot. |
BubbleChart |
Structure used for storing chart related data and the drawing of a Bubble Chart. |
ChartProp |
Structure allowing manipulation of functionality common to all charts. |
DoughnutChart |
Structure used for storing chart related data and the drawing of an Doughnut Chart. |
Histogram |
Structure used for storing chart related data and the drawing of an Histogram. |
LineChart |
Structure used for storing chart related data and the drawing of an Line Chart. |
PieChart |
Structure used for storing chart related data and the drawing of an Pie Chart. |
RadarChart |
Structure used for storing chart related data and the drawing of an Radar Chart. |
StackedAreaChart |
Structure used for storing chart related data and the drawing of an Stacked Area Chart. |
VerticalBarChart |
Structure used for storing chart related data and the drawing of an Bar Chart. |
XYScatterPlot |
Structure used for storing chart related data and the drawing of an XY Scatter Plot. |
Traits
Chart |
Trait implemented by all drawable charts providing the interface for drawing functionality. |
Functions
remove_outliers |
Removes possible outliers from a Vector of numbers. |