Package org.pepstock.charba.client.data
Class Data
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.data.Data
 
 
- 
- All Implemented Interfaces:
- ConfigurationElement,- HasLabels
 
 public final class Data extends NativeObjectContainer implements ConfigurationElement, HasLabels CHART.JS entity object to configure the data options of a chart.
 It contains labels and data sets.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Constructor SummaryConstructors Constructor Description Data(ChartEnvelop<IsChart> envelop)Creates the object with an empty native object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method 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.LabelsHandlergetLabelsHandler()Returns an labels option handler instance.LabelsgetXLabels()Returns the labels for X axes.LabelsgetXLabels(boolean binding)Returns the labels for X axes.LabelsgetYLabels()Returns the labels for Y axes.LabelsgetYLabels(boolean binding)Returns the labels for Y axes.booleanisCanvasObjectHandling()Returnstrueif 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.voidload(IsChart chart, Configuration configuration)Called to enable to load in the a configuration object the specific configuration item (by native object).DatasetretrieveDataset(DatasetContext context)Returns a data set instance by scriptable context, data set index and index.DatasetretrieveDataset(LegendItem legendItem)Returns a data set instance by legend item locator, data set index and index.DatasetretrieveDataset(TooltipItem tooltipItem)Returns a data set instance by tooltip item locator, data set index and index.GradientretrieveFillStyleAsGradient(LegendItem legendItem)Returns a gradient object set as background color for a data set related to legend item.PatternretrieveFillStyleAsPattern(LegendItem legendItem)Returns a pattern object set as background color for a data set related to legend item.GradientretrieveStrokeStyleAsGradient(LegendItem legendItem)Returns a gradient object set as border color for a data set related to legend item.PatternretrieveStrokeStyleAsPattern(LegendItem legendItem)Returns a pattern object set as border color for a data set related to legend item.voidsetCanvasObjectHandling(boolean canvasObjectHandling)Setstrueif 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.voidsetDatasets(Dataset... datasets)Sets a set of data sets for chart.voidsetXLabels(String... labels)Sets the labels for X axes of the data.voidsetXLabels(Labels labels)Sets the labels for X axes of the data.voidsetYLabels(String... labels)Sets the labels for Y axes of the data.voidsetYLabels(Labels labels)Sets the labels for Y axes of the data.- 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckAndGetColor, 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- 
Datapublic Data(ChartEnvelop<IsChart> envelop) Creates the object with an empty native object.- Parameters:
- envelop- envelop containing the chart instance
 
 
- 
 - 
Method Detail- 
getLabelsHandlerpublic LabelsHandler getLabelsHandler() Description copied from interface:HasLabelsReturns an labels option handler instance.- Specified by:
- getLabelsHandlerin interface- HasLabels
- Returns:
- an labels option handler instance
 
 - 
setXLabelspublic void setXLabels(String... labels) Sets the labels for X axes of the data.- Parameters:
- labels- array of labels
 
 - 
setXLabelspublic void setXLabels(Labels labels) Sets the labels for X axes of the data.- Parameters:
- labels- labels object to manage also multi-line labels
 
 - 
getXLabelspublic Labels getXLabels() Returns the labels for X axes.- Returns:
- the labels for X axes
 
 - 
getXLabelspublic Labels getXLabels(boolean binding) Returns the labels for X axes.- Parameters:
- binding- if- truebinds the new labels in the container
- Returns:
- the labels for X axes
 
 - 
setYLabelspublic void setYLabels(String... labels) Sets the labels for Y axes of the data.- Parameters:
- labels- array of labels
 
 - 
setYLabelspublic void setYLabels(Labels labels) Sets the labels for Y axes of the data.- Parameters:
- labels- labels object to manage also multiple line labels
 
 - 
getYLabelspublic Labels getYLabels() Returns the labels for Y axes.- Returns:
- the labels for Y axes
 
 - 
getYLabelspublic Labels getYLabels(boolean binding) Returns the labels for Y axes.- Parameters:
- binding- if- truebinds the new labels in the container
- Returns:
- the labels for Y axes
 
 - 
setDatasetspublic void setDatasets(Dataset... datasets) Sets a set of data sets for chart. If argument isnull, removes all data sets.- Parameters:
- datasets- set of data set. If- null, removes all data sets
 
 - 
getDatasetspublic List<Dataset> getDatasets() Returns the list of data sets.- Returns:
- the list of data sets
 
 - 
getDatasetspublic List<Dataset> getDatasets(boolean binding) Returns the list of data sets.- Parameters:
- binding- if- truebinds the new array list in the container
- Returns:
- the list of data sets
 
 - 
isCanvasObjectHandlingpublic boolean isCanvasObjectHandling() Returnstrueif 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.- Returns:
- trueif the plugin to manage canvas object (gradients and patterns) has been forcedly disable
 
 - 
setCanvasObjectHandlingpublic void setCanvasObjectHandling(boolean canvasObjectHandling) Setstrueif 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.- Parameters:
- canvasObjectHandling-- trueif the plugin to manage canvas object (gradients and patterns) have to be forcedly disable
 
 - 
createActiveElementsByDatasetIndexpublic List<ActiveDatasetElement> createActiveElementsByDatasetIndex(int... datasetIndexes) Creates a list of active elements instances by an array of data set indexes, for visible data sets.- Parameters:
- datasetIndexes- an array of data set indexes
- Returns:
- a list of active elements instances by an array of data set indexes
 
 - 
createActiveElementsByDataIndexpublic List<ActiveDatasetElement> createActiveElementsByDataIndex(int... dataIndexes) Creates a list of active elements instances by an array of data indexes, for all visible data sets.- Parameters:
- dataIndexes- an array of data indexes
- Returns:
- a list of active elements instances by an array of data indexes
 
 - 
retrieveFillStyleAsGradientpublic final Gradient retrieveFillStyleAsGradient(LegendItem legendItem) Returns a gradient object set as background color for a data set related to legend item.- Parameters:
- legendItem- legend item instance to get the data set related to.
- Returns:
- a gradient object or nullif not found by legend item
 
 - 
retrieveStrokeStyleAsGradientpublic final Gradient retrieveStrokeStyleAsGradient(LegendItem legendItem) Returns a gradient object set as border color for a data set related to legend item.- Parameters:
- legendItem- legend item instance to get the data set related to.
- Returns:
- a gradient object or nullif not found by legend item
 
 - 
retrieveFillStyleAsPatternpublic final Pattern retrieveFillStyleAsPattern(LegendItem legendItem) Returns a pattern object set as background color for a data set related to legend item.- Parameters:
- legendItem- legend item instance to get the data set related to.
- Returns:
- a pattern object or nullif not found by legend item
 
 - 
retrieveStrokeStyleAsPatternpublic final Pattern retrieveStrokeStyleAsPattern(LegendItem legendItem) Returns a pattern object set as border color for a data set related to legend item.- Parameters:
- legendItem- legend item instance to get the data set related to.
- Returns:
- a pattern object or nullif not found by legend item
 
 - 
retrieveDatasetpublic final Dataset retrieveDataset(LegendItem legendItem) Returns a data set instance by legend item locator, data set index and index.- Parameters:
- legendItem- legend item instance to get the data set related to.
- Returns:
- a data set instance or nullif not found by legend item
 
 - 
retrieveDatasetpublic final Dataset retrieveDataset(TooltipItem tooltipItem) Returns a data set instance by tooltip item locator, data set index and index.- Parameters:
- tooltipItem- tooltip item instance to get the data set related to.
- Returns:
- a data set instance or nullif not found by tooltip item
 
 - 
retrieveDatasetpublic final Dataset retrieveDataset(DatasetContext context) Returns a data set instance by scriptable context, data set index and index.- Parameters:
- context- legend item instance to get the data set related to.
- Returns:
- a data set instance by scriptable context item or nullif not found by scriptable context
 
 - 
loadpublic void load(IsChart chart, Configuration configuration) Description copied from interface:ConfigurationElementCalled to enable to load in the a configuration object the specific configuration item (by native object).- Specified by:
- loadin interface- ConfigurationElement
- Parameters:
- chart- chart instance
- configuration- chart configuration instance
 
 
- 
 
-