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 name
          name of the serie
 double nullValue
           
 boolean secondYAxis
          if tue, the plotter will use the second Y axis scale to draw the data serie (see Chart.setY2Scale()).
 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)
           
DataSerie(double[] x, double[] y)
          creates a data serie for the array y.
DataSerie(java.lang.Double[] x, java.lang.Double[] y)
           
 
Method Summary
 void addData(java.lang.Object x, java.lang.Object y)
          Adds data to the data serie.
 java.lang.String doubleToString(java.lang.Double d)
           
 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 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).

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
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[] x,
                 java.lang.Double[] y)

DataSerie

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

addData

public void addData(java.lang.Object x,
                    java.lang.Object y)
Adds 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.

doubleToString

public java.lang.String doubleToString(java.lang.Double d)