Package org.pepstock.charba.client.data
Class DataPoint
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.data.AbstractDataPoint
-
- org.pepstock.charba.client.data.DataPoint
-
public final class DataPoint extends AbstractDataPoint
Used for sparse datasets, such as those in scatter charts. Each data point is specified using an object containing x and y properties.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DataPoint()
Creates the object with an empty native object.DataPoint(double x, double y)
Creates the object with the passed point values.DataPoint(double x, double y, double r)
Creates the object with the passed point values (for bubble).DataPoint(double x, FloatingData y)
Creates the object with the passed point values.DataPoint(String x, double y)
Creates the object with the passed point values.DataPoint(String x, FloatingData y)
Creates the object with the passed point values.DataPoint(Date x, double y)
Creates the object with the passed point values.DataPoint(Date x, FloatingData y)
Creates the object with the passed point values.DataPoint(ItemsEnvelop<NativeObject> envelop)
Creates the object with a native object passed as argument by andBaseEnvelop
.
This is called by theDataItem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getR()
Returns the bubble radius in pixels (not scaled).double
getX()
Returns X value as double (for scatter and bubble datasets).Date
getXAsDate()
Returns X value as date for time series.String
getXAsString()
Returns X value as string.DataPointType
getXType()
Returns the object type of data stored as X.double
getY()
Returns Y value.FloatingData
getYAsFloatingData()
Returns Y value.DataPointType
getYType()
Returns the object type of data stored as Y.void
setR(double r)
Sets the bubble radius in pixels (not scaled).
It is not scaled by the chart, it is the raw radius in pixels of the bubble that is drawn on the canvas.void
setX(double x)
Sets X value as double (for scatter and bubble datasets).void
setX(String x)
Sets X value as string.void
setX(Date x)
Sets X value as date for time series.void
setY(double y)
Sets Y value.void
setY(FloatingData y)
Sets Y value.String
toString()
-
Methods inherited from class org.pepstock.charba.client.data.AbstractDataPoint
getAttribute, getAttributeAsDate, getAttributeAsObject, getAttributeAsString, setAttribute, setAttribute, setAttribute, setAttribute
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
DataPoint
public DataPoint()
Creates the object with an empty native object.
-
DataPoint
public DataPoint(double x, double y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(Date x, double y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(String x, double y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(double x, FloatingData y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(Date x, FloatingData y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(String x, FloatingData y)
Creates the object with the passed point values.- Parameters:
x
- x value of data pointy
- y value of data point
-
DataPoint
public DataPoint(double x, double y, double r)
Creates the object with the passed point values (for bubble).- Parameters:
x
- x value of data pointy
- y value of data pointr
- the bubble radius in pixels (not scaled).
-
DataPoint
public DataPoint(ItemsEnvelop<NativeObject> envelop)
Creates the object with a native object passed as argument by andBaseEnvelop
.
This is called by theDataItem
.- Parameters:
envelop
- envelop which contains a native object with a data point
-
-
Method Detail
-
getXType
public DataPointType getXType()
Returns the object type of data stored as X.- Returns:
- the object type of data stored as X
-
setX
public void setX(double x)
Sets X value as double (for scatter and bubble datasets).- Parameters:
x
- X value as double
-
getX
public double getX()
Returns X value as double (for scatter and bubble datasets).- Returns:
- X value as double
-
setX
public void setX(Date x)
Sets X value as date for time series.- Parameters:
x
- X value as date for time series
-
getXAsDate
public Date getXAsDate()
Returns X value as date for time series.- Returns:
- X value as date for time series or
null
if is not set
-
setX
public void setX(String x)
Sets X value as string.- Parameters:
x
- X value as string
-
getXAsString
public String getXAsString()
Returns X value as string.- Returns:
- X value as string or
Undefined.STRING
if is not set
-
getYType
public DataPointType getYType()
Returns the object type of data stored as Y.- Returns:
- the object type of data stored as Y
-
setY
public void setY(double y)
Sets Y value.- Parameters:
y
- Y value.
-
getY
public double getY()
Returns Y value.- Returns:
- Y value.
-
setY
public void setY(FloatingData y)
Sets Y value.- Parameters:
y
- Y value.
-
getYAsFloatingData
public FloatingData getYAsFloatingData()
Returns Y value.- Returns:
- Y value.
-
setR
public void setR(double r)
Sets the bubble radius in pixels (not scaled).
It is not scaled by the chart, it is the raw radius in pixels of the bubble that is drawn on the canvas.- Parameters:
r
- the bubble radius in pixels (not scaled).
-
getR
public double getR()
Returns the bubble radius in pixels (not scaled).- Returns:
- the bubble radius in pixels (not scaled).
-
-