public abstract class Dataset extends NativeObjectContainer implements HasDataset
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Dataset.Property
Name of properties of native object.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Dataset(IsDefaultOptions defaultValues)
Creates the dataset using a default, adding patterns and gradients element.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
applyGradient(Key key,
List<CanvasGradient> canvasGradientsList)
Stores the canvas gradients into dataset object by property name passed as key.
|
protected abstract void |
applyPattern(Key key,
List<CanvasPattern> canvasPatternsList)
Stores the canvas patterns into dataset object by property name passed as key.
|
BackgroundColorCallback |
getBackgroundColorCallback()
Returns the background color callback, if set, otherwise
null. |
BorderColorCallback |
getBorderColorCallback()
Returns the border color callback, if set, otherwise
null. |
BorderWidthCallback |
getBorderWidthCallback()
Returns the border width callback, if set, otherwise
null. |
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.
|
Dataset |
getDataset()
Gets the dataset instance.
|
DataType |
getDataType()
Returns the data type of datasets.
|
protected String |
getDefaultBackgroundColorAsString()
Returns the default background color value based on type of chart.
|
protected String |
getDefaultBorderColorAsString()
Returns the default border color value based on type of chart.
|
protected int |
getDefaultBorderWidth()
Returns the default border width value based on type of chart.
|
protected IsDefaultOptions |
getDefaultValues()
Returns the default options instance.
|
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 |
setBackgroundColor(BackgroundColorCallback backgroundColorCallback)
Sets the background color callback.
|
void |
setBorderColor(BorderColorCallback borderColorCallback)
Sets the border color callback.
|
void |
setBorderWidth(BorderWidthCallback borderWidthCallback)
Sets the border width callback.
|
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.
|
checkValue, 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, typeprotected Dataset(IsDefaultOptions defaultValues)
defaultValues - default optionspublic final int getId()
public final DataType getDataType()
protected final IsDefaultOptions getDefaultValues()
public final BackgroundColorCallback getBackgroundColorCallback()
null.null.public final void setBackgroundColor(BackgroundColorCallback backgroundColorCallback)
backgroundColorCallback - the background color callback.public final BorderColorCallback getBorderColorCallback()
null.null.public final void setBorderColor(BorderColorCallback borderColorCallback)
borderColorCallback - the border color callback.public final BorderWidthCallback getBorderWidthCallback()
null.null.public final void setBorderWidth(BorderWidthCallback borderWidthCallback)
borderWidthCallback - the border width callback to setprotected String getDefaultBackgroundColorAsString()
protected String getDefaultBorderColorAsString()
protected int getDefaultBorderWidth()
protected abstract void applyPattern(Key key, List<CanvasPattern> canvasPatternsList)
key - key property name to use to store canvas patterns into dataset object.canvasPatternsList - list of canvas patternsprotected abstract void applyGradient(Key key, List<CanvasGradient> canvasGradientsList)
key - key property name to use to store canvas gradients into dataset object.canvasGradientsList - list of canvas gradientspublic void setHidden(boolean hidden)
hidden - if the dataset will appear or not.public boolean isHidden()
falsepublic 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 Dataset getDataset()
HasDatasetgetDataset in interface HasDatasetpublic void setType(Type type)
type - type of dataset.public final Type getType()
null if not set.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 factory is null.