Package org.pepstock.charba.client.items
Class DatasetItem
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.items.DatasetItem
-
public final class DatasetItem extends NativeObjectContainer
Calling some methods on your chart instance passing an argument of an event, will return the elements at the event position.
Created and passed by CHART.JS and provide dataset information.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DatasetItem(ChartEnvelop<NativeObject> envelop)
Creates the item using an envelop with the native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatasetItemController
getController()
Returns the dataset controller.List<DatasetElement>
getElements()
Returns a list of dataset elements.int
getIndex()
Returns the dataset index.IndexAxis
getIndexAxis()
Returns the dataset index axis.ScaleId
getIndexAxisID()
Returns the index axis ID.ScaleItem
getIndexScale()
Returns the index scale item ornull
if not exists.
IfIndexAxis
=IndexAxis.Y
then iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.String
getLabel()
Returns the dataset label.int
getOrder()
Returns the dataset order.ScaleId
getRAxisID()
Returns the R axis ID.ScaleItem
getRScale()
Returns the R scale item ornull
if not exists.double
getTotal()
Returns the dataset total value of data.Type
getType()
Returns the type of dataset.ScaleId
getValueAxisID()
Returns the value axis ID.ScaleItem
getValueScale()
Returns the value scale item ornull
if not exists.
IfIndexAxis
=IndexAxis.Y
then iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.ScaleId
getXAxisID()
Returns the X axis ID.ScaleItem
getXScale()
Returns the X scale item ornull
if not exists.ScaleId
getYAxisID()
Returns the Y axis ID.ScaleItem
getYScale()
Returns the Y scale item ornull
if not exists.boolean
isHidden()
Returns if the dataset is hidden.boolean
isVisible()
Returns if the dataset is visible.-
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
-
DatasetItem
public DatasetItem(ChartEnvelop<NativeObject> envelop)
Creates the item using an envelop with the native java script object which contains all properties.- Parameters:
envelop
- envelop with the native java script object which contains all properties.
-
-
Method Detail
-
getController
public DatasetItemController getController()
Returns the dataset controller.- Returns:
- the dataset controller
-
getType
public Type getType()
Returns the type of dataset.- Returns:
- the type of dataset. If not set or invalid, the default is
ChartType.BAR
.
-
isVisible
public boolean isVisible()
Returns if the dataset is visible.- Returns:
true
if the dataset is visible, otherwise isUndefined.BOOLEAN
.
-
isHidden
public boolean isHidden()
Returns if the dataset is hidden.- Returns:
true
if the dataset is hidden, otherwise isUndefined.BOOLEAN
.
-
getIndex
public int getIndex()
Returns the dataset index.- Returns:
- the dataset index.
-
getIndexAxis
public IndexAxis getIndexAxis()
Returns the dataset index axis.- Returns:
- the dataset index axis or
null
if not found.
-
getOrder
public int getOrder()
Returns the dataset order.- Returns:
- the dataset order.
-
getLabel
public String getLabel()
Returns the dataset label.- Returns:
- the dataset label.
-
getYAxisID
public ScaleId getYAxisID()
Returns the Y axis ID.- Returns:
- the Y axis ID.
-
getYScale
public ScaleItem getYScale()
Returns the Y scale item ornull
if not exists.- Returns:
- the Y scale item or
null
if not exists
-
getXAxisID
public ScaleId getXAxisID()
Returns the X axis ID.- Returns:
- the X axis ID.
-
getXScale
public ScaleItem getXScale()
Returns the X scale item ornull
if not exists.- Returns:
- the X scale item or
null
if not exists
-
getRAxisID
public ScaleId getRAxisID()
Returns the R axis ID.- Returns:
- the R axis ID.
-
getRScale
public ScaleItem getRScale()
Returns the R scale item ornull
if not exists.- Returns:
- the R scale item or
null
if not exists
-
getValueAxisID
public ScaleId getValueAxisID()
Returns the value axis ID.- Returns:
- the value axis ID.
-
getValueScale
public ScaleItem getValueScale()
Returns the value scale item ornull
if not exists.
IfIndexAxis
=IndexAxis.Y
then iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.- Returns:
- the value scale item or
null
if not exists
-
getIndexAxisID
public ScaleId getIndexAxisID()
Returns the index axis ID.- Returns:
- the index axis ID.
-
getIndexScale
public ScaleItem getIndexScale()
Returns the index scale item ornull
if not exists.
IfIndexAxis
=IndexAxis.Y
then iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.- Returns:
- the index scale item or
null
if not exists
-
getTotal
public double getTotal()
Returns the dataset total value of data.- Returns:
- the dataset total value of data.
-
getElements
public List<DatasetElement> getElements()
Returns a list of dataset elements.- Returns:
- a list of dataset elements.
-
-