public final class Data extends NativeObjectContainer implements ConfigurationElement, HasLabels
Constructor and Description |
---|
Data(ChartEnvelop<IsChart> envelop)
Creates the object with an empty native object.
|
Modifier and Type | Method and Description |
---|---|
List<ActiveDatasetElement> |
createActiveElementsByDataIndex(int... dataIndexes)
Creates a list of active elements instances by an array of data indexes, for all visible data sets.
|
List<ActiveDatasetElement> |
createActiveElementsByDatasetIndex(int... datasetIndexes)
Creates a list of active elements instances by an array of data set indexes, for visible data sets.
|
List<Dataset> |
getDatasets()
Returns the list of data sets.
|
List<Dataset> |
getDatasets(boolean binding)
Returns the list of data sets.
|
LabelsHandler |
getLabelsHandler()
Returns an labels option handler instance.
|
Labels |
getXLabels()
Returns the labels for X axes.
|
Labels |
getXLabels(boolean binding)
Returns the labels for X axes.
|
Labels |
getYLabels()
Returns the labels for Y axes.
|
Labels |
getYLabels(boolean binding)
Returns the labels for Y axes.
|
boolean |
isCanvasObjectHandling()
Returns
true if the plugin to manage canvas object (gradients and patterns) has been forcedly disable.Pay attention that disabling the handler, your data sets configuration with gradients or patterns will e showed with default color. |
void |
load(IsChart chart,
Configuration configuration)
Called to enable to load in the a configuration object the specific configuration item (by native object).
|
Dataset |
retrieveDataset(DatasetContext context)
Returns a data set instance by scriptable context, data set index and index.
|
Dataset |
retrieveDataset(LegendItem legendItem)
Returns a data set instance by legend item locator, data set index and index.
|
Dataset |
retrieveDataset(TooltipItem tooltipItem)
Returns a data set instance by tooltip item locator, data set index and index.
|
Gradient |
retrieveFillStyleAsGradient(LegendItem legendItem)
Returns a gradient object set as background color for a data set related to legend item.
|
Pattern |
retrieveFillStyleAsPattern(LegendItem legendItem)
Returns a pattern object set as background color for a data set related to legend item.
|
Gradient |
retrieveStrokeStyleAsGradient(LegendItem legendItem)
Returns a gradient object set as border color for a data set related to legend item.
|
Pattern |
retrieveStrokeStyleAsPattern(LegendItem legendItem)
Returns a pattern object set as border color for a data set related to legend item.
|
void |
setCanvasObjectHandling(boolean canvasObjectHandling)
Sets
true if the plugin to manage canvas object (gradients and patterns) have to be forcedly disable.Pay attention that disabling the handler, your data sets configuration with gradients or patterns will e showed with default color. |
void |
setDatasets(Dataset... datasets)
Sets a set of data sets for chart.
|
void |
setXLabels(Labels labels)
Sets the labels for X axes of the data.
|
void |
setXLabels(String... labels)
Sets the labels for X axes of the data.
|
void |
setYLabels(Labels labels)
Sets the labels for Y axes of the data.
|
void |
setYLabels(String... labels)
Sets the labels for Y axes of the data.
|
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, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public Data(ChartEnvelop<IsChart> envelop)
envelop
- envelop containing the chart instancepublic LabelsHandler getLabelsHandler()
HasLabels
getLabelsHandler
in interface HasLabels
public void setXLabels(String... labels)
labels
- array of labelspublic void setXLabels(Labels labels)
labels
- labels object to manage also multi-line labelspublic Labels getXLabels()
public Labels getXLabels(boolean binding)
binding
- if true
binds the new labels in the containerpublic void setYLabels(String... labels)
labels
- array of labelspublic void setYLabels(Labels labels)
labels
- labels object to manage also multiple line labelspublic Labels getYLabels()
public Labels getYLabels(boolean binding)
binding
- if true
binds the new labels in the containerpublic void setDatasets(Dataset... datasets)
null
, removes all data sets.datasets
- set of data set. If null
, removes all data setspublic List<Dataset> getDatasets()
public List<Dataset> getDatasets(boolean binding)
binding
- if true
binds the new array list in the containerpublic boolean isCanvasObjectHandling()
true
if the plugin to manage canvas object (gradients and patterns) has been forcedly disable.true
if the plugin to manage canvas object (gradients and patterns) has been forcedly disablepublic void setCanvasObjectHandling(boolean canvasObjectHandling)
true
if the plugin to manage canvas object (gradients and patterns) have to be forcedly disable.canvasObjectHandling
- true
if the plugin to manage canvas object (gradients and patterns) have to be forcedly disablepublic List<ActiveDatasetElement> createActiveElementsByDatasetIndex(int... datasetIndexes)
datasetIndexes
- an array of data set indexespublic List<ActiveDatasetElement> createActiveElementsByDataIndex(int... dataIndexes)
dataIndexes
- an array of data indexespublic final Gradient retrieveFillStyleAsGradient(LegendItem legendItem)
legendItem
- legend item instance to get the data set related to.null
if not found by legend itempublic final Gradient retrieveStrokeStyleAsGradient(LegendItem legendItem)
legendItem
- legend item instance to get the data set related to.null
if not found by legend itempublic final Pattern retrieveFillStyleAsPattern(LegendItem legendItem)
legendItem
- legend item instance to get the data set related to.null
if not found by legend itempublic final Pattern retrieveStrokeStyleAsPattern(LegendItem legendItem)
legendItem
- legend item instance to get the data set related to.null
if not found by legend itempublic final Dataset retrieveDataset(LegendItem legendItem)
legendItem
- legend item instance to get the data set related to.null
if not found by legend itempublic final Dataset retrieveDataset(TooltipItem tooltipItem)
tooltipItem
- tooltip item instance to get the data set related to.null
if not found by tooltip itempublic final Dataset retrieveDataset(DatasetContext context)
context
- legend item instance to get the data set related to.null
if not found by scriptable contextpublic void load(IsChart chart, Configuration configuration)
ConfigurationElement
load
in interface ConfigurationElement
chart
- chart instanceconfiguration
- chart configuration instance