public class XYLineChart extends XYChart
XYLineChart class is the simplest way to produce curve plots only.
Each XYLineChart object is linked with a
XYListSeriesCollection data set.| Constructor and Description |
|---|
XYLineChart()
Initializes a new XYLineChart instance with an empty data set.
|
XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][]... data)
Initializes a new XYLineChart instance with sets of points data.
|
XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][] data,
int numPoints)
Initializes a new XYLineChart instance with sets of points data.
|
XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][] data,
int x,
int y)
Initializes a new XYLineChart instance using subsets of data.
|
XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
DoubleArrayList... data)
Initializes a new XYLineChart instance with data data.
|
XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
XYSeriesCollection data)
Initializes a new XYLineChart instance with data data.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(double[][] data)
Adds the new collection of data series data into the series collection.
|
int |
add(double[][] data,
int numPoints)
Adds the new collection of data series data into the series collection.
|
int |
add(double[] x,
double[] y)
Adds a data series into the series collection.
|
int |
add(double[] x,
double[] y,
int numPoints)
Adds a data series into the series collection.
|
int |
add(double[] x,
double[] y,
java.lang.String name,
java.lang.String plotStyle)
Adds a data series into the series collection.
|
XYListSeriesCollection |
getSeriesCollection()
Returns the chart's dataset.
|
void |
setSeriesCollection(XYListSeriesCollection dataset)
Links a new dataset to the current chart.
|
void |
setTicksSynchro(int s)
Synchronizes X-axis ticks to the s-th series x-values.
|
java.lang.String |
toLatex(double width,
double height)
Exports the chart to a LATEX source code using PGF/TikZ.
|
javax.swing.JFrame |
view(int width,
int height)
Displays chart on the screen using Swing.
|
javax.swing.JFrame |
viewBar(int width,
int height)
Displays bar chart on the screen using Swing.
|
disableGrid, enableGrid, getChartMargin, getJFreeChart, getTitle, getXAxis, getYAxis, setAutoRange, setAutoRange, setAutoRange00, setChartMargin, setLatexDocFlag, setManualRange, setManualRange, setManualRange00, setprobFlag, setTitle, toLatexFilepublic XYLineChart()
public XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][]... data)
For example, if one n-row matrix data1 is given as argument data, then the first row data1[0] represents the x-coordinate vector, and every other row data1 [i], i = 1,…, n - 1, represents a y-coordinate set for a curve. Therefore matrix data1[i][j], i = 0,…, n - 1, corresponds to n - 1 curves, all with the same x-coordinates.
However, one may want to plot several curves with different x-coordinates. In that case, one should give the curves as matrices with two rows. For examples, if the argument data is made of three 2-row matrices data1, data2 and data3, then they represents three different curves, data*[0] being the x-coordinates, and data*[1] the y-coordinates of the curves.
title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.data - series of point sets.public XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][] data,
int numPoints)
title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.data - series of point sets.numPoints - Number of points to plotpublic XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
double[][] data,
int x,
int y)
title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.data - series of point sets.x - Index of data forming the x-coordinatesy - Index of data forming the y-coordinatespublic XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
DoubleArrayList... data)
DoubleArrayList from the Colt library is
used to store the data. The description is similar to the
constructor YListChart with double[]... data.title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.data - series of point sets.public XYLineChart(java.lang.String title,
java.lang.String XLabel,
java.lang.String YLabel,
XYSeriesCollection data)
XYSeriesCollection is a
JFreeChart container class to store XY plots.title - chart title.XLabel - Label on x-axis.YLabel - Label on y-axis.data - series collection.public int add(double[] x,
double[] y,
java.lang.String name,
java.lang.String plotStyle)
x - xi coordinates.y - yi coordinates.name - Name of the series.plotStyle - Plot style of the series.public int add(double[] x,
double[] y)
x - xi coordinates.y - yi coordinates.public int add(double[] x,
double[] y,
int numPoints)
x - xi coordinates.y - yi coordinates.numPoints - Number of points to addpublic int add(double[][] data)
data - series of point sets.public int add(double[][] data,
int numPoints)
data - series of point sets.numPoints - Number of points to plotpublic XYListSeriesCollection getSeriesCollection()
public void setSeriesCollection(XYListSeriesCollection dataset)
dataset - new dataset.public void setTicksSynchro(int s)
setTicksSynchro in class XYCharts - series used to define ticks.public javax.swing.JFrame view(int width,
int height)
public javax.swing.JFrame viewBar(int width,
int height)
width - frame width in pixels.height - frame height in pixels.public java.lang.String toLatex(double width,
double height)
XYChartTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.