public class MultipleDatasetChart
extends java.lang.Object
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.| Constructor and Description |
|---|
MultipleDatasetChart()
Initializes a new MultipleDatasetChart.
|
MultipleDatasetChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel)
Initializes a new MultipleDatasetChart instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(SSJXYSeriesCollection dataset)
Adds a new dataset to the chart at the end of the list and returns its position.
|
void |
disableGrid()
Disables the background grid.
|
void |
enableGrid(double xstep,
double ystep)
Puts grid on the background.
|
SSJXYSeriesCollection |
get()
Gets the primary dataset.
|
SSJXYSeriesCollection |
get(int datasetNum)
Gets the element at the specified position in the dataset list.
|
JFreeChart |
getJFreeChart()
Returns the JFreeChart variable associated with this chart.
|
java.util.ArrayList<SSJXYSeriesCollection> |
getList()
Returns the dataset list.
|
java.lang.String |
getTitle()
Gets the current chart title.
|
Axis |
getXAxis()
Returns the chart's domain axis (x-axis) object.
|
Axis |
getYAxis()
Returns the chart's range axis (y-axis) object.
|
void |
set(int datasetNum,
SSJXYSeriesCollection dataset)
Replaces the element at the specified position in the dataset list with the specified element.
|
void |
set(SSJXYSeriesCollection dataset)
Sets the primary dataset for the plot, replacing the existing dataset if there is one.
|
void |
setAutoRange()
Sets chart range to automatic values.
|
void |
setLatexDocFlag(boolean flag)
Same as in
XYChart. |
void |
setManualRange(double[] axisRange)
Sets new x-axis and y-axis bounds, with format: axisRange = [xmin, xmax, ymin, ymax].
|
void |
setTitle(java.lang.String title)
Sets a title to the chart.
|
java.lang.String |
toLatex(double width,
double height)
Same as in
XYChart. |
javax.swing.JFrame |
view(int width,
int height)
Displays chart on the screen using Swing.
|
public MultipleDatasetChart()
public MultipleDatasetChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel)
title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.public JFreeChart getJFreeChart()
public Axis getXAxis()
public Axis getYAxis()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
view.title - chart title.public void setAutoRange()
public void setManualRange(double[] axisRange)
axisRange - new axis ranges.public int add(SSJXYSeriesCollection dataset)
dataset - dataset to add.public SSJXYSeriesCollection get()
public void set(SSJXYSeriesCollection dataset)
dataset - the new primary dataset.public SSJXYSeriesCollection get(int datasetNum)
datasetNum - position in the dataset list.public void set(int datasetNum,
SSJXYSeriesCollection dataset)
datasetNum - position in the dataset list.dataset - dataset list.public java.util.ArrayList<SSJXYSeriesCollection> getList()
public javax.swing.JFrame view(int width,
int height)
width - frame width in pixels.height - frame height in pixels.public void enableGrid(double xstep,
double ystep)
xstep - sets the stepping in the x-direction.ystep - sets the stepping in the y-direction.public void disableGrid()
public java.lang.String toLatex(double width,
double height)
XYChart.width - Chart's width in centimeters.height - Chart's height in centimeters.public void setLatexDocFlag(boolean flag)
XYChart.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.