Class Labels
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.datalabels.Labels
-
public final class Labels extends NativeObjectContainer
Base object to map multi labels options forDataLabelsPlugin.ID
plugin configuration.
It's possible to define multiple labels for each data element using the this object.
It is an object where each property represents a new label, the key being the label key and the value being the options specific to each label.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelItem
createLabel(String id)
Returns new options for specific id.LabelItem
createLabel(DataLabelId id)
Returns new options for specific id.LabelItem
getLabel(String id)
Returns the stored options for specific id.LabelItem
getLabel(DataLabelId id)
Returns the stored options for specific id.List<Key>
getLabelKeys()
Returns the list of all keys related to stored options.boolean
hasLabel(String id)
Returnstrue
if there is a stored options for specific id.boolean
hasLabel(DataLabelId id)
Returnstrue
if there is a stored options for specific key.void
removeLabel(String id)
Removes an existing label for specific id.void
removeLabel(DataLabelId id)
Removes an existing label for specific id.-
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, 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
-
-
-
-
Method Detail
-
createLabel
public LabelItem createLabel(String id)
Returns new options for specific id.- Parameters:
id
- id of the options- Returns:
- the new option for that id
-
createLabel
public LabelItem createLabel(DataLabelId id)
Returns new options for specific id.- Parameters:
id
- id of the options- Returns:
- the new option for that id
-
getLabel
public LabelItem getLabel(String id)
Returns the stored options for specific id.- Parameters:
id
- id of the options- Returns:
- the stored option or
null
if no options are stored for that id
-
getLabel
public LabelItem getLabel(DataLabelId id)
Returns the stored options for specific id.- Parameters:
id
- id of the options- Returns:
- the stored option or
null
if no options are stored for that id
-
hasLabel
public boolean hasLabel(String id)
Returnstrue
if there is a stored options for specific id.- Parameters:
id
- id of the options- Returns:
true
if there is a stored options for specific id
-
hasLabel
public boolean hasLabel(DataLabelId id)
Returnstrue
if there is a stored options for specific key.- Parameters:
id
- key of the options- Returns:
true
if there is a stored options for specific key
-
removeLabel
public void removeLabel(String id)
Removes an existing label for specific id.- Parameters:
id
- id of the options
-
removeLabel
public void removeLabel(DataLabelId id)
Removes an existing label for specific id.- Parameters:
id
- key of the options
-
-