|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.charts4j.Data
public class Data
Type that contains the numeric information that will be rendered in the
chart.
The constructor and static factory methods in this class take values from 0
to 100. If your data does not fall in that range, you need to scale it so it
does. This is the case for negative number, for instance. If you are having
trouble scaling your data please see DataUtil
.
Numbers outside the 0 to 100 range will be considered invalid and will be
treated as invalid according to the chart type.
For the curious, behind the scenes, the data in this class is converted to
the Google Chart API simple, text, or extended encoding.
DataUtil
,
Plots
,
GCharts
Field Summary | |
---|---|
static Data |
INVALID
Invalid data series. |
static double |
MAX_VALUE
Maximum value of data is 100. |
static double |
MIN_VALUE
Minimum value of data is zero. |
Constructor Summary | |
---|---|
Data(double... data)
The data that will eventually be rendered by a chart. |
Method Summary | |
---|---|
double[] |
getData()
Get a copy of the backing array. |
int |
getSize()
Get the size of the dataset. |
static Data |
newData(double... data)
Static factory method for creating Data instance. |
static Data |
newData(List<? extends Number> data)
Static factory method for creating Data instance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double MIN_VALUE
public static final double MAX_VALUE
public static final Data INVALID
Constructor Detail |
---|
public Data(double... data)
newData(double...)
and newData(List)
should be
used in preference to this constructor.
data
- Double data. Double values must be between 0 and 100. data
array is defensively copied. Numbers outside the 0 to 100
range will be considered invalid and will be treated as
invalid according to the chart type.Method Detail |
---|
public String toString()
toString
in class Object
public final double[] getData()
public final int getSize()
public static Data newData(double... data)
Data
instance.
data
- Double data. Double values must be between 0 and 100. data
array is deep copied so the array reference the client passes
is not kept. Numbers outside the 0 to 100 range will be
considered invalid and will be treated as invalid according to
the chart type.
public static Data newData(List<? extends Number> data)
Data
instance.
data
- Number data. Number values must be between 0 and 100. List is
defensively copied. Numbers outside the 0 to 100 range will be
considered invalid and will be treated as invalid according to
the chart type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |