Package org.pepstock.charba.client.items
Class ActiveDatasetElement
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.items.ActiveDatasetElement
-
public final class ActiveDatasetElement extends NativeObjectContainer
Calling some methods on your chart instance passing an argument of an event, will return the elements at the event position.
The elements are mapped by this object.
This is the CHART.JS item with all needed info about a selected data set.
This object has been created and passed to event handler or callbacks to apply own logic.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static org.pepstock.charba.client.items.ActiveDatasetElement.ActiveDatasetElementFactory
FACTORY
Factory instance to create active data set elements.
-
Constructor Summary
Constructors Constructor Description ActiveDatasetElement()
Creates an empty data set element.ActiveDatasetElement(int datasetIndex, int dataIndex)
Creates a data set element, setting data set and data element indexes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDatasetIndex()
Returns the index of the data set.int
getIndex()
Returns the index of the data element.void
setDatasetIndex(int datasetIndex)
Sets the index of the data set.void
setIndex(int dataIndex)
Sets the index of the data element.-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
ActiveDatasetElement
public ActiveDatasetElement(int datasetIndex, int dataIndex)
Creates a data set element, setting data set and data element indexes.- Parameters:
datasetIndex
- the index of the data set.dataIndex
- the index of the data element
-
ActiveDatasetElement
public ActiveDatasetElement()
Creates an empty data set element.
-
-
Method Detail
-
setDatasetIndex
public void setDatasetIndex(int datasetIndex)
Sets the index of the data set.- Parameters:
datasetIndex
- the index of the data set.
-
getDatasetIndex
public int getDatasetIndex()
Returns the index of the data set.- Returns:
- the index of the data set.
-
setIndex
public void setIndex(int dataIndex)
Sets the index of the data element.- Parameters:
dataIndex
- the index of the data element
-
getIndex
public int getIndex()
Returns the index of the data element.- Returns:
- the index of the data element
-
-