|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.charts.MultipleDatasetChart
public class MultipleDatasetChart
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.
Constructor Summary | |
---|---|
MultipleDatasetChart()
Initializes a new MultipleDatasetChart. |
|
MultipleDatasetChart(String title,
String XLabel,
String YLabel)
Initializes a new MultipleDatasetChart instance. |
Method Summary | |
---|---|
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. |
ArrayList<SSJXYSeriesCollection> |
getList()
Returns the dataset list. |
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(String title)
Sets a title to the chart. |
String |
toLatex(double width,
double height)
Same as in XYChart . |
JFrame |
view(int width,
int height)
Displays chart on the screen using Swing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultipleDatasetChart()
public MultipleDatasetChart(String title, String XLabel, String YLabel)
title
- chart title.XLabel
- Label on x-axis.YLabel
- Label on y-axis.Method Detail |
---|
public JFreeChart getJFreeChart()
public Axis getXAxis()
public Axis getYAxis()
public String getTitle()
public void setTitle(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 ArrayList<SSJXYSeriesCollection> getList()
public 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 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
.
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |