Provides tools to plot many datasets on the same chart. More...
Public Member Functions | |
| MultipleDatasetChart () | |
| Initializes a new MultipleDatasetChart. | |
| MultipleDatasetChart (String title, String XLabel, String YLabel) | |
| Initializes a new MultipleDatasetChart instance. | |
| JFreeChart | getJFreeChart () |
| Returns the JFreeChart variable associated with this chart. | |
| Axis | getXAxis () |
| Returns the chart’s domain axis ( \(x\)-axis) object. | |
| Axis | getYAxis () |
| Returns the chart’s range axis ( \(y\)-axis) object. | |
| String | getTitle () |
| Gets the current chart title. | |
| void | setTitle (String title) |
| Sets a title to the chart. | |
| void | setAutoRange () |
| Sets chart range to automatic values. | |
| void | setManualRange (double[] axisRange) |
| Sets new \(x\)-axis and \(y\)-axis bounds, with format: axisRange = [xmin, xmax, ymin, ymax]. | |
| int | add (SSJXYSeriesCollection dataset) |
| Adds a new dataset to the chart at the end of the list and returns its position. | |
| SSJXYSeriesCollection | get () |
| Gets the primary dataset. | |
| void | set (SSJXYSeriesCollection dataset) |
| Sets the primary dataset for the plot, replacing the existing dataset if there is one. | |
| SSJXYSeriesCollection | get (int datasetNum) |
| Gets the element at the specified position in the dataset list. | |
| void | set (int datasetNum, SSJXYSeriesCollection dataset) |
| Replaces the element at the specified position in the dataset list with the specified element. | |
| ArrayList< SSJXYSeriesCollection > | getList () |
| Returns the dataset list. | |
| JFrame | view (int width, int height) |
| Displays chart on the screen using Swing. | |
| void | enableGrid (double xstep, double ystep) |
| Puts grid on the background. | |
| void | disableGrid () |
| Disables the background grid. | |
LaTeX-specific method @{ | |
| String | toLatex (double width, double height) |
| Same as in XYChart. | |
| void | setLatexDocFlag (boolean flag) |
| Same as in XYChart. | |
Provides tools to plot many datasets on the same chart.
This class is mainly used to draw plots with different styles. Class XYChart and its subclasses are to be preferred to draw simple charts with one style. Datasets are stored in an ArrayList. The first dataset is called as the primary dataset.
Definition at line 47 of file MultipleDatasetChart.java.
| umontreal.ssj.charts.MultipleDatasetChart.MultipleDatasetChart | ( | ) |
Initializes a new MultipleDatasetChart.
Definition at line 65 of file MultipleDatasetChart.java.
| umontreal.ssj.charts.MultipleDatasetChart.MultipleDatasetChart | ( | String | title, |
| String | XLabel, | ||
| String | YLabel ) |
Initializes a new MultipleDatasetChart instance.
title sets a title, XLabel is a short description of the \(x\)-axis, and YLabel is a short description of the \(y\)-axis.
| title | chart title. |
| XLabel | Label on \(x\)-axis. |
| YLabel | Label on \(y\)-axis. |
Definition at line 93 of file MultipleDatasetChart.java.
| int umontreal.ssj.charts.MultipleDatasetChart.add | ( | SSJXYSeriesCollection | dataset | ) |
Adds a new dataset to the chart at the end of the list and returns its position.
| dataset | dataset to add. |
Definition at line 200 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.disableGrid | ( | ) |
Disables the background grid.
Definition at line 308 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.enableGrid | ( | double | xstep, |
| double | ystep ) |
Puts grid on the background.
It is important to note that the grid is always placed in such a way that it contains the axes. Thus, the grid does not always have an intersection at the corner points; this occurs only if the corner points are multiples of the stepping. xstep and ystep sets the stepping in each direction.
| xstep | sets the stepping in the \(x\)-direction. |
| ystep | sets the stepping in the \(y\)-direction. |
Definition at line 299 of file MultipleDatasetChart.java.
| SSJXYSeriesCollection umontreal.ssj.charts.MultipleDatasetChart.get | ( | ) |
| SSJXYSeriesCollection umontreal.ssj.charts.MultipleDatasetChart.get | ( | int | datasetNum | ) |
Gets the element at the specified position in the dataset list.
| datasetNum | position in the dataset list. |
Definition at line 238 of file MultipleDatasetChart.java.
| JFreeChart umontreal.ssj.charts.MultipleDatasetChart.getJFreeChart | ( | ) |
Returns the JFreeChart variable associated with this chart.
Definition at line 115 of file MultipleDatasetChart.java.
| ArrayList< SSJXYSeriesCollection > umontreal.ssj.charts.MultipleDatasetChart.getList | ( | ) |
Returns the dataset list.
Definition at line 260 of file MultipleDatasetChart.java.
| String umontreal.ssj.charts.MultipleDatasetChart.getTitle | ( | ) |
Gets the current chart title.
Definition at line 142 of file MultipleDatasetChart.java.
| Axis umontreal.ssj.charts.MultipleDatasetChart.getXAxis | ( | ) |
Returns the chart’s domain axis ( \(x\)-axis) object.
Definition at line 124 of file MultipleDatasetChart.java.
| Axis umontreal.ssj.charts.MultipleDatasetChart.getYAxis | ( | ) |
Returns the chart’s range axis ( \(y\)-axis) object.
Definition at line 133 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.set | ( | int | datasetNum, |
| SSJXYSeriesCollection | dataset ) |
Replaces the element at the specified position in the dataset list with the specified element.
| datasetNum | position in the dataset list. |
| dataset | dataset list. |
Definition at line 249 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.set | ( | SSJXYSeriesCollection | dataset | ) |
Sets the primary dataset for the plot, replacing the existing dataset if there is one.
| dataset | the new primary dataset. |
Definition at line 226 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.setAutoRange | ( | ) |
Sets chart range to automatic values.
Definition at line 159 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.setLatexDocFlag | ( | boolean | flag | ) |
Same as in XYChart.
Definition at line 396 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.setManualRange | ( | double[] | axisRange | ) |
Sets new \(x\)-axis and \(y\)-axis bounds, with format: axisRange = [xmin, xmax, ymin, ymax].
| axisRange | new axis ranges. |
Definition at line 183 of file MultipleDatasetChart.java.
| void umontreal.ssj.charts.MultipleDatasetChart.setTitle | ( | String | title | ) |
Sets a title to the chart.
This title will appear on the chart displayed by method view.
| title | chart title. |
Definition at line 152 of file MultipleDatasetChart.java.
| String umontreal.ssj.charts.MultipleDatasetChart.toLatex | ( | double | width, |
| double | height ) |
Same as in XYChart.
| width | Chart’s width in centimeters. |
| height | Chart’s height in centimeters. |
Definition at line 322 of file MultipleDatasetChart.java.
| JFrame umontreal.ssj.charts.MultipleDatasetChart.view | ( | int | width, |
| int | height ) |
Displays chart on the screen using Swing.
This method creates an application containing a chart panel displaying the chart. The created frame is positioned on-screen, and displayed before it is returned. The width and the height of the chart are measured in pixels.
| width | frame width in pixels. |
| height | frame height in pixels. |
Definition at line 273 of file MultipleDatasetChart.java.