Class MatrixDataset
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.data.Dataset
-
- org.pepstock.charba.client.data.HoverFlexDataset
-
- org.pepstock.charba.client.matrix.MatrixDataset
-
- All Implemented Interfaces:
HasCallbackScope
,HasDataset
,IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,HasAnimationOptions
public final class MatrixDataset extends HoverFlexDataset
The matrix data set allows to specify the values for showing magnitude of a phenomenon as color in two dimensions.
The variation in color may be by hue or intensity, giving obvious visual cues to the reader about how the phenomenon is clustered or varies over space.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.data.Dataset
Dataset.CanvasObjectProperty, Dataset.CommonProperty
-
-
Field Summary
Fields Modifier and Type Field Description static org.pepstock.charba.client.matrix.MatrixDataset.DataPointFactory
DATAPOINTS_FACTORY
Factory to createMatrixDataPoint
s.static int
DEFAULT_BORDER_RADIUS
Default border radius, 0.static int
DEFAULT_BORDER_WIDTH
Default border width, 0.static double
DEFAULT_HEIGHT
Default height, in pixels, 20.0.static double
DEFAULT_WIDTH
Default width, in pixels, 20.0.-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Constructor Description MatrixDataset()
Creates a data set.
It uses the global options has default.MatrixDataset(IsDefaultOptions defaultValues)
Creates a data set setting the defaults value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBorderRadius()
Returns the border radius (in pixels).BarBorderRadius
getBorderRadiusAsObject()
Returns the border radius (in pixels).BorderRadiusCallback<DatasetContext>
getBorderRadiusCallback()
Returns the callback to set the border radius (in pixels).BarBorderWidth
getBorderWidthAsObject()
Returns the border width (in pixels).BarBorderWidthCallback
getBorderWidthCallback()
Returns the callback to set the border width (in pixels).List<Double>
getData(boolean binding)
Throws an exception because not available.List<MatrixDataPoint>
getDataPoints()
Returns the matrix data property of a dataset for a chart is specified as an array of matrix data pointsList<MatrixDataPoint>
getDataPoints(boolean binding)
Returns the matrix data property of a dataset for a chart is specified as an array of matrix data pointsprotected int
getDefaultBorderWidth()
Returns the default border width value based on type of chart.double
getHeight()
Returns the height of matrix element in pixels.SizeCallback
getHeightCallback()
Returns the height callback to set the height of matrix element in pixels.BarBorderWidth
getHoverBorderWidthAsObject()
Returns the border width (in pixels), when hovered.BarBorderWidthCallback
getHoverBorderWidthCallback()
Returns the callback to set the border width (in pixels), when hovered.double
getWidth()
Returns the width of matrix element in pixels.SizeCallback
getWidthCallback()
Returns the width callback to set the width of matrix element in pixels.Anchor
getXAnchor()
Returns the anchor point on X orientation of matrix element.Anchor
getYAnchor()
Returns the anchor point on Y orientation of matrix element.void
setBorderRadius(int borderRadius)
Sets the border radius (in pixels).void
setBorderRadius(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
Sets the callback to set the border radius (in pixels).void
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius (in pixels).void
setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).void
setBorderWidth(BarBorderWidthCallback borderWidthCallback)
Sets the callback to set the border width (in pixels).void
setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the border width (in pixels).void
setBorderWidth(BarBorderWidth borderWidth)
Sets the border width (in pixels).void
setData(double... values)
Throws an exception because not available.void
setData(List<Double> values)
Throws an exception because not available.void
setDataPoints(List<MatrixDataPoint> datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.void
setDataPoints(MatrixDataPoint... datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.void
setHeight(double height)
Sets the height of matrix element in pixels.void
setHeight(NativeCallback heightCallback)
Sets the height callback to set the height of matrix element in pixels.void
setHeight(SizeCallback heightCallback)
Sets the height callback to set the height of matrix element in pixels.void
setHoverBorderWidth(BarBorderWidthCallback hoverBorderWidthCallback)
Sets the callback to set the border width (in pixels), when hovered.void
setHoverBorderWidth(NativeCallback hoverBorderWidthCallback)
Sets the callback to set the border width (in pixels), when hovered.void
setHoverBorderWidth(BarBorderWidth hoverBorderWidth)
Sets the border width (in pixels), when hovered.void
setWidth(double width)
Sets the width of matrix element in pixels.void
setWidth(NativeCallback widthCallback)
Sets the width callback to set the width of matrix element in pixels.void
setWidth(SizeCallback widthCallback)
Sets the width callback to set the width of matrix element in pixels.void
setXAnchor(Anchor anchor)
Sets the anchor point on X orientation of matrix element.void
setYAnchor(Anchor anchor)
Sets the anchor point on Y orientation of matrix element.-
Methods inherited from class org.pepstock.charba.client.data.HoverFlexDataset
getBackgroundColor, getBackgroundColorAsGradient, getBackgroundColorAsPatterns, getBackgroundColorAsString, getBorderColor, getBorderColorAsGradient, getBorderColorAsString, getBorderWidth, getColors, getHoverBackgroundColor, getHoverBackgroundColorAsGradient, getHoverBackgroundColorAsPatterns, getHoverBackgroundColorAsString, getHoverBorderColor, getHoverBorderColorAsGradient, getHoverBorderColorAsString, getHoverBorderWidth, getWidths, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderWidth, setColors, setColors, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderWidth, setWidths
-
Methods inherited from class org.pepstock.charba.client.data.Dataset
createContext, getAnimationContainer, getBackgroundColorCallback, getBorderColorCallback, getClip, getClipAsObject, getData, getDataCount, getDataset, getDataType, getDefaultBackgroundColorAsString, getDefaultBorderColorAsString, getDefaultHoverBackgroundColorAsString, getDefaultHoverBorderColorAsString, getDefaultHoverBorderWidth, getDefaultValues, getHoverBackgroundColorCallback, getHoverBorderColorCallback, getId, getLabel, getOptions, getOptions, getScope, getType, getTypedDataset, hasOptions, invokeColorCallback, isClip, isHidden, isNormalized, isParsing, removeOptions, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setClip, setClip, setClip, setHidden, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setLabel, setNormalized, setOptions, setOptions, setParsing
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasAnimationOptions
getAnimation, getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
-
-
-
-
Field Detail
-
DATAPOINTS_FACTORY
public static final org.pepstock.charba.client.matrix.MatrixDataset.DataPointFactory DATAPOINTS_FACTORY
Factory to createMatrixDataPoint
s.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default border width, 0.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_RADIUS
public static final int DEFAULT_BORDER_RADIUS
Default border radius, 0.- See Also:
- Constant Field Values
-
DEFAULT_WIDTH
public static final double DEFAULT_WIDTH
Default width, in pixels, 20.0.- See Also:
- Constant Field Values
-
DEFAULT_HEIGHT
public static final double DEFAULT_HEIGHT
Default height, in pixels, 20.0.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MatrixDataset
public MatrixDataset()
Creates a data set.
It uses the global options has default.
-
MatrixDataset
public MatrixDataset(IsDefaultOptions defaultValues)
Creates a data set setting the defaults value.- Parameters:
defaultValues
- default options
-
-
Method Detail
-
getDefaultBorderWidth
protected int getDefaultBorderWidth()
Description copied from class:Dataset
Returns the default border width value based on type of chart.- Overrides:
getDefaultBorderWidth
in classDataset
- Returns:
- the default border width value based on type of chart.
-
setDataPoints
public void setDataPoints(MatrixDataPoint... datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.- Parameters:
datapoints
- an array of data points
-
setDataPoints
public void setDataPoints(List<MatrixDataPoint> datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.- Parameters:
datapoints
- a list of data points
-
getDataPoints
public List<MatrixDataPoint> getDataPoints()
Returns the matrix data property of a dataset for a chart is specified as an array of matrix data points- Returns:
- a list of matrix data points or an empty list of data points.
-
getDataPoints
public List<MatrixDataPoint> getDataPoints(boolean binding)
Returns the matrix data property of a dataset for a chart is specified as an array of matrix data points- Parameters:
binding
- iftrue
binds the new array list in the container- Returns:
- a list of matrix data points or an empty list of data points
-
setHeight
public void setHeight(double height)
Sets the height of matrix element in pixels.- Parameters:
height
- the height of matrix element in pixels
-
getHeight
public double getHeight()
Returns the height of matrix element in pixels.- Returns:
- the height of matrix element in pixels
-
setWidth
public void setWidth(double width)
Sets the width of matrix element in pixels.- Parameters:
width
- the width of matrix element in pixels
-
getWidth
public double getWidth()
Returns the width of matrix element in pixels.- Returns:
- the width of matrix element in pixels.
-
setXAnchor
public void setXAnchor(Anchor anchor)
Sets the anchor point on X orientation of matrix element.- Parameters:
anchor
- the anchor point on X orientation of matrix element
-
getXAnchor
public Anchor getXAnchor()
Returns the anchor point on X orientation of matrix element.- Returns:
- the anchor point on X orientation of matrix element
-
setYAnchor
public void setYAnchor(Anchor anchor)
Sets the anchor point on Y orientation of matrix element.- Parameters:
anchor
- the anchor point on Y orientation of matrix element
-
getYAnchor
public Anchor getYAnchor()
Returns the anchor point on Y orientation of matrix element.- Returns:
- the anchor point on Y orientation of matrix element
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the border radius (in pixels).- Parameters:
borderRadius
- the border radius (in pixels).
-
setBorderRadius
public void setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).- Parameters:
borderRadius
- the border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getBorderRadiusAsObject
public BarBorderRadius getBorderRadiusAsObject()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
setBorderWidth
public void setBorderWidth(BarBorderWidth borderWidth)
Sets the border width (in pixels).- Parameters:
borderWidth
- the border width (in pixels).
-
getBorderWidthAsObject
public BarBorderWidth getBorderWidthAsObject()
Returns the border width (in pixels).- Returns:
- the border width (in pixels).
-
setHoverBorderWidth
public void setHoverBorderWidth(BarBorderWidth hoverBorderWidth)
Sets the border width (in pixels), when hovered.- Parameters:
hoverBorderWidth
- the border width (in pixels), when hovered.
-
getHoverBorderWidthAsObject
public BarBorderWidth getHoverBorderWidthAsObject()
Returns the border width (in pixels), when hovered.- Returns:
- the border width (in pixels), when hovered.
-
setWidth
public void setWidth(SizeCallback widthCallback)
Sets the width callback to set the width of matrix element in pixels.- Parameters:
widthCallback
- the width callback
-
getWidthCallback
public SizeCallback getWidthCallback()
Returns the width callback to set the width of matrix element in pixels.- Returns:
- the width callback
-
setWidth
public void setWidth(NativeCallback widthCallback)
Sets the width callback to set the width of matrix element in pixels.- Parameters:
widthCallback
- the width callback
-
setHeight
public void setHeight(SizeCallback heightCallback)
Sets the height callback to set the height of matrix element in pixels.- Parameters:
heightCallback
- the height callback
-
getHeightCallback
public SizeCallback getHeightCallback()
Returns the height callback to set the height of matrix element in pixels.- Returns:
- the height callback
-
setHeight
public void setHeight(NativeCallback heightCallback)
Sets the height callback to set the height of matrix element in pixels.- Parameters:
heightCallback
- the height callback
-
setBorderRadius
public void setBorderRadius(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
Sets the callback to set the border radius (in pixels).- Parameters:
borderRadiusCallback
- the border radius callback
-
getBorderRadiusCallback
public BorderRadiusCallback<DatasetContext> getBorderRadiusCallback()
Returns the callback to set the border radius (in pixels).- Returns:
- the border radius callback
-
setBorderRadius
public void setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius (in pixels).- Parameters:
borderRadiusCallback
- the border radius callback
-
setBorderWidth
public void setBorderWidth(BarBorderWidthCallback borderWidthCallback)
Sets the callback to set the border width (in pixels).- Parameters:
borderWidthCallback
- the border width callback
-
getBorderWidthCallback
public BarBorderWidthCallback getBorderWidthCallback()
Returns the callback to set the border width (in pixels).- Returns:
- the border width callback
-
setBorderWidth
public void setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the border width (in pixels).- Parameters:
borderWidthCallback
- the border width callback
-
setHoverBorderWidth
public void setHoverBorderWidth(BarBorderWidthCallback hoverBorderWidthCallback)
Sets the callback to set the border width (in pixels), when hovered.- Parameters:
hoverBorderWidthCallback
- the hover border width callback
-
getHoverBorderWidthCallback
public BarBorderWidthCallback getHoverBorderWidthCallback()
Returns the callback to set the border width (in pixels), when hovered.- Returns:
- the hover border width callback
-
setHoverBorderWidth
public void setHoverBorderWidth(NativeCallback hoverBorderWidthCallback)
Sets the callback to set the border width (in pixels), when hovered.- Parameters:
hoverBorderWidthCallback
- the hover border width callback
-
setData
public void setData(double... values)
Throws an exception because not available.
-
-