Package org.pepstock.charba.client.items
Class DatasetReference
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.items.DatasetReference
-
public final class DatasetReference 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, providing the right indexes to get the data set.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DatasetReference(AbstractDatasetContext context, ChartElement element)
Creates the item reference using a a scriptale context and a data elementDatasetReference(IsChart chart, ChartEnvelop<NativeObject> envelop)
Creates the item using a chart instance and a native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDatasetIndex()
Returns the data set item index.ChartElement
getElement()
Returns the data set item element.int
getIndex()
Returns the data set item data index.-
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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
DatasetReference
public DatasetReference(AbstractDatasetContext context, ChartElement element)
Creates the item reference using a a scriptale context and a data element- Parameters:
context
- scriptable context instanceelement
- chart element to add to the object
-
DatasetReference
public DatasetReference(IsChart chart, ChartEnvelop<NativeObject> envelop)
Creates the item using a chart instance and a native java script object which contains all properties.- Parameters:
chart
- chart instance needed to create the dataset referenceenvelop
- envelop from chart with native java script object which contains all properties
-
-
Method Detail
-
getElement
public final ChartElement getElement()
Returns the data set item element.- Returns:
- the data set element
-
getDatasetIndex
public final int getDatasetIndex()
Returns the data set item index.- Returns:
- the data set item index.
-
getIndex
public final int getIndex()
Returns the data set item data index.- Returns:
- the data set item data index.
-
-