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 DatasetItemControllergetController()Returns the dataset controller.List<DatasetElement>getElements()Returns a list of dataset elements.intgetIndex()Returns the dataset index.IndexAxisgetIndexAxis()Returns the dataset index axis.ScaleIdgetIndexAxisID()Returns the index axis ID.ScaleItemgetIndexScale()Returns the index scale item ornullif not exists.
IfIndexAxis=IndexAxis.Ythen iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.StringgetLabel()Returns the dataset label.intgetOrder()Returns the dataset order.ScaleIdgetRAxisID()Returns the R axis ID.ScaleItemgetRScale()Returns the R scale item ornullif not exists.doublegetTotal()Returns the dataset total value of data.TypegetType()Returns the type of dataset.ScaleIdgetValueAxisID()Returns the value axis ID.ScaleItemgetValueScale()Returns the value scale item ornullif not exists.
IfIndexAxis=IndexAxis.Ythen iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.ScaleIdgetXAxisID()Returns the X axis ID.ScaleItemgetXScale()Returns the X scale item ornullif not exists.ScaleIdgetYAxisID()Returns the Y axis ID.ScaleItemgetYScale()Returns the Y scale item ornullif not exists.booleanisHidden()Returns if the dataset is hidden.booleanisVisible()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, 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:
trueif the dataset is visible, otherwise isUndefined.BOOLEAN.
-
isHidden
public boolean isHidden()
Returns if the dataset is hidden.- Returns:
trueif 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
nullif 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 ornullif not exists.- Returns:
- the Y scale item or
nullif 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 ornullif not exists.- Returns:
- the X scale item or
nullif 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 ornullif not exists.- Returns:
- the R scale item or
nullif 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 ornullif not exists.
IfIndexAxis=IndexAxis.Ythen iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.- Returns:
- the value scale item or
nullif 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 ornullif not exists.
IfIndexAxis=IndexAxis.Ythen iScale === yScale and vScale === xScale.
For radar, iScale === vScale === rScale.- Returns:
- the index scale item or
nullif 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.
-
-