package umontreal.iro.lecuyer.charts;

/**
 * This class extends the class
 * {@link umontreal.iro.lecuyer.charts.XYLineChart XYLineChart}.
 * Each {@link YListChart} object is associated with a
 * {@link umontreal.iro.lecuyer.charts.YListSeriesCollection YListSeriesCollection} data set.
 * The data is given as one or more lists of y-coordinates. The x-coordinates are
 * given by the indices + 1 of each y-coordinate in the given lists.
 * 
 */
public class YListChart extends XYLineChart  {




   /**
    * Initializes a new YListChart instance with set of points data.
    *    title is a title, XLabel is a short description of
    *    the x-axis, and YLabel  a short description of the y-axis.
    *    The input vectors represents a set of plotting data. More specifically,
    *    each vector data represents a y-coordinates set.
    *    Position in the vector will form the x-coordinates.
    *    Indeed, the value data[j] corresponds to the point
    *    
    * (j + 1,data[j]) (but rescaled) on the chart.
    * 
    * @param title chart title.
    * 
    *    @param XLabel Label on x-axis.
    * 
    *    @param YLabel Label on y-axis.
    * 
    *    @param data series of point sets.
    * 
    * 
    */
   public YListChart (String title, String XLabel, String YLabel,
                      double[]... data)  {
      super();
      dataset = new YListSeriesCollection(data);
      init (title, XLabel, YLabel);
   }


   /**
    * Initializes a new YListChart instance with a set of points 
    *    data.
    *    title is a title, XLabel is a short description of
    *    the x-axis, and YLabel  a short description of the y-axis.
    *    The input vector represents a set of plotting data.
    *    Position in the vector gives the x-coordinates of the curve.
    *    The value data[j] corresponds to the point
    *    (j + 1, data[j]) (but rescaled on the chart) for the curve.
    *    However, only the first numPoints of data
    *     will be considered to plot the curve.  
    * 
    * @param title chart title.
    * 
    *    @param XLabel Label on x-axis.
    * 
    *    @param YLabel Label on y-axis.
    * 
    *    @param data point set.
    * 
    *    @param numPoints number of points to plot
    * 
    * 
    */
   public YListChart (String title, String XLabel, String YLabel,
                      double[] data, int numPoints)  {
      super();
      dataset = new YListSeriesCollection(data, numPoints);
      init (title, XLabel, YLabel);
   }


   /**
    * Initializes a new YListChart instance with set of points data.
    *    title is a title, XLabel is a short description of
    *    the x-axis, and YLabel  a short description of the y-axis.
    *    The input vectors represents a set of plotting data. More specifically,
    *    for a n-row matrix data, each row data
    * [i], i = 0,…, n - 1, represents a y-coordinate set for a curve. 
    *    Position in the vector gives the x-coordinates of the curves.
    *    Indeed, the value data[i][j] corresponds to the point
    *    (j + 1, data[i][j]) (but rescaled on the chart) for curve i.
    *    However, only the first numPoints of each data[i] 
    *     will be considered to plot each curve.  
    * 
    * @param title chart title.
    * 
    *    @param XLabel Label on x-axis.
    * 
    *    @param YLabel Label on y-axis.
    * 
    *    @param data series of point sets.
    * 
    *    @param numPoints number of points to plot
    * 
    */
   public YListChart (String title, String XLabel, String YLabel,
                      double[][] data, int numPoints)  {
      super();
      dataset = new YListSeriesCollection(data, numPoints);
      init (title, XLabel, YLabel);
   }
}

 

Ads help maintain this website.