Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.java4less.rchart
Class DataSerie

    java.lang.Object
      |
      +--com.java4less.rchart.DataSerie

Direct Known Subclasses:
  BarDataSerie, LineDataSerie, PieDataSerie

public class DataSerie
extends java.lang.Object

A data serie contains the values that must be plotted on the chart. It is nothing more than a list of values an a description of the values must be plotted (color, line style ...).

Field Summary
`java.lang.String[]` | `dataLabels` labels for the values in the serie
`java.util.Vector` | `hotAreas` Internal.
`java.lang.String[]` | `htmlLinks` html links for the points when creating an html image map
`java.lang.String` | `labelTemplate` template for the ChartLabel object using the @ tags.
`java.lang.String` | `name` name of the serie
`double` | `nullValue`
`Axis` | `secondaryXAxis` shall this serie use a secondary x axis?
`Axis` | `secondaryYAxis` shall this serie use a secondary y axis?
`boolean` | `secondYAxis` if tue, the plotter will use the second Y axis scale to draw the data serie (see Chart.setY2Scale()).
`java.lang.String[]` | `tips` tips for the values of the series
`java.lang.String` | `valueFormat` format of the labels of the values.

Constructor Summary
`DataSerie()` creates an empty data serie.
`DataSerie(double[] y)` creates a data serie for the array y.
`DataSerie(java.lang.Double[] y)` creates a data serie for the array y.
`DataSerie(double[] x, double[] y)` creates a data serie for the array y.
`DataSerie(java.lang.Double[] x, java.lang.Double[] y)` creates a data serie for the array of points (pairs of x,y values).
`DataSerie(double[] y, int startingXValue)`
`DataSerie(java.lang.Double[] y, int startingXValue)`

Method Summary
`void` | `addData(java.lang.Object x, java.lang.Object y)` adds a point data to the data serie.
`java.lang.Object` | `getElementX(int i)` returns x value of the element i.
`java.lang.Object` | `getElementY(int i)` returns y value of the element i.
`int` | `getSize()` returns the size of the data serie.
`void` | `replaceXValueAt(int index, double newValue)` replace X value
`void` | `replaceXYValueAt(int index, double newValueX, double newValueY)` replace pair of values X and Y
`void` | `replaceYValueAt(int index, double newValue)` replace Y value
`void` | `setDatax(double[] x)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### hotAreas

    public java.util.Vector hotAreas

  Internal. This vector contains a list of Polygon object that describe the hot area ( where the user can click) in order to select the value.

### dataLabels

    public java.lang.String[] dataLabels

  labels for the values in the serie

### name

    public java.lang.String name

  name of the serie

### valueFormat

    public java.lang.String valueFormat

  format of the labels of the values. The default is ####.## (see also Axis.scaleLabelFormat).

### labelTemplate

    public java.lang.String labelTemplate

  template for the ChartLabel object using the @ tags. The place holder #value# will be replaced with the value for the tick.

### secondYAxis

    public boolean secondYAxis

  if tue, the plotter will use the second Y axis scale to draw the data serie (see Chart.setY2Scale()).

### nullValue

    public double nullValue

### secondaryXAxis

    public Axis secondaryXAxis

  shall this serie use a secondary x axis?

### secondaryYAxis

    public Axis secondaryYAxis

  shall this serie use a secondary y axis?

### tips

    public java.lang.String[] tips

  tips for the values of the series

### htmlLinks

    public java.lang.String[] htmlLinks

  html links for the points when creating an html image map

Constructor Detail

### DataSerie

    public DataSerie()

  creates an empty data serie.

### DataSerie

    public DataSerie(double[] x,
                     double[] y)

  creates a data serie for the array y. The data of the array x will be used for the axis x.

### DataSerie

    public DataSerie(double[] y)

  creates a data serie for the array y. The data for the other axis will be created automatically starting by 0 (i.e. 0,1,2,3,..).

### DataSerie

    public DataSerie(java.lang.Double[] y)

  creates a data serie for the array y. The data for the other axis will be created automatically starting by 0 (i.e. 0,1,2,3,..).

### DataSerie

    public DataSerie(double[] y,
                     int startingXValue)

### DataSerie

    public DataSerie(java.lang.Double[] y,
                     int startingXValue)

### DataSerie

    public DataSerie(java.lang.Double[] x,
                     java.lang.Double[] y)

  creates a data serie for the array of points (pairs of x,y values).

Method Detail

### addData

    public void addData(java.lang.Object x,
                        java.lang.Object y)

  adds a point data to the data serie. Must be used if an empty data serie was created.

### getSize

    public int getSize()

  returns the size of the data serie.

### setDatax

    public void setDatax(double[] x)

### getElementX

    public java.lang.Object getElementX(int i)

  returns x value of the element i.

### getElementY

    public java.lang.Object getElementY(int i)

  returns y value of the element i.

### replaceYValueAt

    public void replaceYValueAt(int index,
                                double newValue)

  replace Y value

  Parameters:
    `index` - index of the value to replace
    `newValue` -
  Returns:

### replaceXValueAt

    public void replaceXValueAt(int index,
                                double newValue)

  replace X value

  Parameters:
    `index` - index of the value to replace
    `newValue` -
  Returns:

### replaceXYValueAt

    public void replaceXYValueAt(int index,
                                 double newValueX,
                                 double newValueY)

  replace pair of values X and Y

  Parameters:
    `index` - index of the value to replace
    `newValueX` -
    `newValueY` -
  Returns:

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD