public abstract class Dataset extends NativeObjectContainer
Modifier and Type | Method and Description |
---|---|
List<Double> |
getData()
Returns the data property of a dataset for a chart is specified as an array of numbers.
|
List<Double> |
getData(boolean binding)
Returns the data property of a dataset for a chart is specified as an array of numbers.
|
DataType |
getDataType()
Returns the data type of datasets.
|
int |
getId()
Returns the unique id of datasets.
|
String |
getLabel()
Returns the label for the dataset which appears in the legend and tooltips.
|
<T extends NativeObjectContainer> |
getOptions(String pluginId,
NativeObjectContainerFactory<T> factory)
Returns the plugin dataset configuration, if exist.
|
Type |
getType()
Returns the type of dataset, based on type of chart.
|
boolean |
hasOptions(String pluginId)
Checks if there is any dataset configuration for a specific plugin, by its id.
|
boolean |
isHidden()
Returns if the dataset will appear or not.
|
void |
setData(double... values)
Sets the data property of a dataset for a chart is specified as an array of numbers.
|
void |
setData(List<Double> values)
Sets the data property of a dataset for a chart is specified as an array of numbers.
|
void |
setHidden(boolean hidden)
Sets if the dataset will appear or not.
|
void |
setLabel(String label)
Sets the label for the dataset which appears in the legend and tooltips.
|
<T extends NativeObjectContainer> |
setOptions(String pluginId,
T options)
Sets the plugin dataset configuration.
|
void |
setType(Type type)
Sets the type of dataset based on type of chart.
|
getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public final int getId()
public final DataType getDataType()
public void setHidden(boolean hidden)
hidden
- if the dataset will appear or not.public boolean isHidden()
false
public void setLabel(String label)
label
- the label for the dataset which appears in the legend and tooltips.public String getLabel()
public void setData(double... values)
values
- an array of numberspublic void setData(List<Double> values)
values
- list of numbers.public List<Double> getData()
DataType.numbers
.public List<Double> getData(boolean binding)
binding
- if true
binds the new array list into containerDataType.numbers
.public final void setType(Type type)
type
- type of dataset.public final Type getType()
ChartType.bar
.public final <T extends NativeObjectContainer> void setOptions(String pluginId, T options)
T
- type of native object container to storepluginId
- plugin id.options
- java script object used to configure the plugin. Pass null
to remove the configuration if
exist.public final boolean hasOptions(String pluginId)
pluginId
- plugin id.true
if there is an options, otherwise false
.public final <T extends NativeObjectContainer> T getOptions(String pluginId, NativeObjectContainerFactory<T> factory)
T
- type of native object container to returnpluginId
- plugin id.factory
- factory instance to create a native object container.null
if not exist.