Provides tools to plot many datasets on the same chart.
More...
|
| MultipleDatasetChart () |
| Initializes a new MultipleDatasetChart .
|
|
| MultipleDatasetChart (String title, String XLabel, String YLabel) |
| Initializes a new MultipleDatasetChart instance. More...
|
|
JFreeChart | getJFreeChart () |
| Returns the JFreeChart variable associated with this chart. More...
|
|
Axis | getXAxis () |
| Returns the chart’s domain axis ( \(x\)-axis) object. More...
|
|
Axis | getYAxis () |
| Returns the chart’s range axis ( \(y\)-axis) object. More...
|
|
String | getTitle () |
| Gets the current chart title. More...
|
|
void | setTitle (String title) |
| Sets a title to the chart. More...
|
|
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]. More...
|
|
int | add (SSJXYSeriesCollection dataset) |
| Adds a new dataset to the chart at the end of the list and returns its position. More...
|
|
SSJXYSeriesCollection | get () |
| Gets the primary dataset. More...
|
|
void | set (SSJXYSeriesCollection dataset) |
| Sets the primary dataset for the plot, replacing the existing dataset if there is one. More...
|
|
SSJXYSeriesCollection | get (int datasetNum) |
| Gets the element at the specified position in the dataset list. More...
|
|
void | set (int datasetNum, SSJXYSeriesCollection dataset) |
| Replaces the element at the specified position in the dataset list with the specified element. More...
|
|
ArrayList< SSJXYSeriesCollection > | getList () |
| Returns the dataset list. More...
|
|
JFrame | view (int width, int height) |
| Displays chart on the screen using Swing. More...
|
|
void | enableGrid (double xstep, double ystep) |
| Puts grid on the background. More...
|
|
void | disableGrid () |
| Disables the background grid.
|
|
|
ArrayList< SSJXYSeriesCollection > | datasetList |
|
Axis | XAxis |
|
Axis | YAxis |
|
JFreeChart | chart |
|
boolean | latexDocFlag = true |
|
boolean | autoRange = true |
|
double [] | manualRange |
|
boolean | grid = false |
|
double | xstepGrid |
|
double | ystepGrid |
|
|
String | toLatex (double width, double height) |
| Same as in XYChart. More...
|
|
void | setLatexDocFlag (boolean flag) |
| Same as in XYChart.
|
|
double | computeXScale (double position) |
|
double | computeYScale (double position) |
|
double | computeScale (double[] bounds) |
|
Provides tools to plot many datasets on the same chart.
This class is mainly used to draw plots with different styles. Class umontreal.ssj.charts.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.
◆ MultipleDatasetChart()
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.
- Parameters
-
title | chart title. |
XLabel | Label on \(x\)-axis. |
YLabel | Label on \(y\)-axis. |
◆ add()
Adds a new dataset to the chart at the end of the list and returns its position.
- Parameters
-
- Returns
- the dataset position in the list.
◆ enableGrid()
void 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.
- Parameters
-
xstep | sets the stepping in the \(x\)-direction. |
ystep | sets the stepping in the \(y\)-direction. |
◆ get() [1/2]
Gets the primary dataset.
- Returns
- dataset.
◆ get() [2/2]
Gets the element at the specified position in the dataset list.
- Parameters
-
datasetNum | position in the dataset list. |
- Returns
- dataset.
◆ getJFreeChart()
JFreeChart getJFreeChart |
( |
| ) |
|
Returns the JFreeChart
variable associated with this chart.
- Returns
- the associated JFreeChart variable.
◆ getList()
Returns the dataset list.
- Returns
- dataset list.
◆ getTitle()
Gets the current chart title.
- Returns
- Chart title.
◆ getXAxis()
Returns the chart’s domain axis ( \(x\)-axis) object.
- Returns
- chart’s domain axis ( \(x\)-axis) object.
◆ getYAxis()
Returns the chart’s range axis ( \(y\)-axis) object.
- Returns
- chart’s range axis ( \(y\)-axis) object.
◆ set() [1/2]
Sets the primary dataset for the plot, replacing the existing dataset if there is one.
- Parameters
-
dataset | the new primary dataset. |
◆ set() [2/2]
Replaces the element at the specified position in the dataset list with the specified element.
- Parameters
-
datasetNum | position in the dataset list. |
dataset | dataset list. |
◆ setManualRange()
void setManualRange |
( |
double [] |
axisRange | ) |
|
Sets new \(x\)-axis and \(y\)-axis bounds, with format: axisRange
= [xmin, xmax, ymin, ymax].
- Parameters
-
axisRange | new axis ranges. |
◆ setTitle()
void setTitle |
( |
String |
title | ) |
|
Sets a title to the chart.
This title will appear on the chart displayed by method view.
- Parameters
-
◆ toLatex()
String toLatex |
( |
double |
width, |
|
|
double |
height |
|
) |
| |
Same as in XYChart.
- Parameters
-
width | Chart’s width in centimeters. |
height | Chart’s height in centimeters. |
◆ view()
JFrame 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.
- Parameters
-
width | frame width in pixels. |
height | frame height in pixels. |
The documentation for this class was generated from the following file:
- MultipleDatasetChart.java