Class TreeMapDataset
- 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.treemap.TreeMapDataset
-
- All Implemented Interfaces:
HasCallbackScope
,HasDataset
,IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,HasAnimationOptions
public final class TreeMapDataset extends HoverFlexDataset
The treemap data set allows to specify the values for displaying hierarchical data using nested rectangles.- 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.treemap.TreeMapDataset.DataPointFactory
DATAPOINTS_FACTORY
Factory to createTreeMapDataPoint
s.static int
DEFAULT_BORDER_RADIUS
Default border radius, 0.static int
DEFAULT_BORDER_WIDTH
Default border width, 0.static boolean
DEFAULT_RTL
Default right-to-left, false.static double
DEFAULT_SPACING
Default spacing, 0.5.static String
DEFAULT_TREE_LEAF_KEY
Default tree leaf node key, "_leaf".-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Constructor Description TreeMapDataset()
Creates a data set.
It uses the global options has default.TreeMapDataset(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 border radius callback, if set, otherwisenull
.Captions
getCaptions()
Returns the captions object.List<Double>
getData(boolean binding)
Throws an exception because not available.List<TreeMapDataPoint>
getDataPoints()
Returns the treemap data property of a dataset for a chart is specified as an array of treemap data pointsprotected int
getDefaultBorderWidth()
Returns the default border width value based on type of chart.Dividers
getDividers()
Returns the dividers object.Set<Key>
getGroups()
Returns the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.Set<String>
getGroupsAsString()
Returns the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.Key
getKey()
Returns the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.String
getKeyAsString()
Returns the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.Labels
getLabels()
Returns the labels object.double
getSpacing()
Returns the fixed spacing among rectangles.Set<Key>
getSumKeys()
Returns multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.Set<String>
getSumKeysAsString()
Returns multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.List<Double>
getTree()
Returns the tree data property of a data set for a chart is specified as a list of numbers.List<Double>
getTree(boolean binding)
Returns the tree data property of a data set for a chart is specified as an list of numbers.Key
getTreeLeafKey()
Returns the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.String
getTreeLeafKeyAsString()
Returns the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.NativeObject
getTreeNativeObject()
Returns he tree data property of a data set for a chart is specified as an object.<T extends NativeObjectContainer>
TgetTreeObject(NativeObjectContainerFactory<T> factory)
Returns he tree data property of a data set for a chart is specified as an object.<T extends NativeObjectContainer>
List<T>getTreeObjects(NativeObjectContainerFactory<T> factory)
Returns the tree data property of a data set for a chart is specified as a list of objects.<T extends NativeObjectContainer>
List<T>getTreeObjects(NativeObjectContainerFactory<T> factory, boolean binding)
Returns the tree data property of a data set for a chart is specified as an list of objects.boolean
isRtl()
Returnstrue
for rendering the rectangles from right to left.void
setBorderRadius(int radius)
Sets the border radius.void
setBorderRadius(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
Sets the border radius callback.void
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the border radius callback.void
setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).void
setData(double... values)
Throws an exception because not available.void
setData(List<Double> values)
Throws an exception because not available.void
setGroups(String... groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.void
setGroups(Set<Key> groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.void
setGroups(Key... groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.void
setKey(String key)
Sets the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.void
setKey(Key key)
Sets the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.void
setRtl(boolean rtl)
Setstrue
for rendering the rectangles from right to left.void
setSpacing(double spacing)
Sets the fixed spacing among rectangles.void
setSumKeys(String... sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.void
setSumKeys(Set<Key> sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.void
setSumKeys(Key... sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.void
setTree(double... values)
Sets the tree data property of a data set for a chart is specified as an array of numbers.void
setTree(List<Double> values)
Sets the tree data property of a data set for a chart is specified as a list of numbers.void
setTreeLeafKey(String key)
Sets the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.void
setTreeLeafKey(Key key)
Sets the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.void
setTreeNativeObject(NativeObject value)
Sets the tree data property of a data set for a chart is specified as an object.<T extends NativeObjectContainer>
voidsetTreeObject(T value)
Sets the tree data property of a data set for a chart is specified as an object.<T extends NativeObjectContainer>
voidsetTreeObjects(T[] values)
Sets the tree data property of a data set for a chart is specified as an array of objects.<T extends NativeObjectContainer>
voidsetTreeObjetcs(List<T> values)
Sets the tree data property of a data set for a chart is specified as a list of objects.-
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.treemap.TreeMapDataset.DataPointFactory DATAPOINTS_FACTORY
Factory to createTreeMapDataPoint
s.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default border width, 0.- See Also:
- Constant Field Values
-
DEFAULT_SPACING
public static final double DEFAULT_SPACING
Default spacing, 0.5.- 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_RTL
public static final boolean DEFAULT_RTL
Default right-to-left, false.- See Also:
- Constant Field Values
-
DEFAULT_TREE_LEAF_KEY
public static final String DEFAULT_TREE_LEAF_KEY
Default tree leaf node key, "_leaf".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TreeMapDataset
public TreeMapDataset()
Creates a data set.
It uses the global options has default.
-
TreeMapDataset
public TreeMapDataset(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.
-
getDividers
public Dividers getDividers()
Returns the dividers object.- Returns:
- the dividers object.
-
getCaptions
public Captions getCaptions()
Returns the captions object.- Returns:
- the captions object.
-
getLabels
public Labels getLabels()
Returns the labels object.- Returns:
- the labels object.
-
getDataPoints
public List<TreeMapDataPoint> getDataPoints()
Returns the treemap data property of a dataset for a chart is specified as an array of treemap data points- Returns:
- a list of treemap data points or an empty list of data points.
-
setTree
public void setTree(double... values)
Sets the tree data property of a data set for a chart is specified as an array of numbers.- Parameters:
values
- an array of numbers
-
setTree
public void setTree(List<Double> values)
Sets the tree data property of a data set for a chart is specified as a list of numbers.- Parameters:
values
- list of numbers.
-
getTree
public List<Double> getTree()
Returns the tree data property of a data set for a chart is specified as a list of numbers.- Returns:
- list of numbers.
-
getTree
public List<Double> getTree(boolean binding)
Returns the tree data property of a data set for a chart is specified as an list of numbers.- Parameters:
binding
- iftrue
binds the new array list in the container- Returns:
- list of numbers
-
setTreeObjects
public <T extends NativeObjectContainer> void setTreeObjects(T[] values)
Sets the tree data property of a data set for a chart is specified as an array of objects.- Type Parameters:
T
- type of tree objects- Parameters:
values
- an array of objects
-
setTreeObjetcs
public <T extends NativeObjectContainer> void setTreeObjetcs(List<T> values)
Sets the tree data property of a data set for a chart is specified as a list of objects.- Type Parameters:
T
- type of tree objects- Parameters:
values
- list of objects.
-
getTreeObjects
public <T extends NativeObjectContainer> List<T> getTreeObjects(NativeObjectContainerFactory<T> factory)
Returns the tree data property of a data set for a chart is specified as a list of objects.- Type Parameters:
T
- type of tree objects- Parameters:
factory
- instance of factory to create the native object- Returns:
- list of objects.
-
getTreeObjects
public <T extends NativeObjectContainer> List<T> getTreeObjects(NativeObjectContainerFactory<T> factory, boolean binding)
Returns the tree data property of a data set for a chart is specified as an list of objects.- Type Parameters:
T
- type of tree objects- Parameters:
factory
- instance of factory to create the native objectbinding
- iftrue
binds the new array list in the container- Returns:
- list of objects
-
setTreeNativeObject
public void setTreeNativeObject(NativeObject value)
Sets the tree data property of a data set for a chart is specified as an object.- Parameters:
value
- the object instance
-
getTreeNativeObject
public NativeObject getTreeNativeObject()
Returns he tree data property of a data set for a chart is specified as an object.- Returns:
- the object instance.
-
setTreeObject
public <T extends NativeObjectContainer> void setTreeObject(T value)
Sets the tree data property of a data set for a chart is specified as an object.- Type Parameters:
T
- type of tree object- Parameters:
value
- the object instance
-
getTreeObject
public <T extends NativeObjectContainer> T getTreeObject(NativeObjectContainerFactory<T> factory)
Returns he tree data property of a data set for a chart is specified as an object.- Type Parameters:
T
- type of tree object- Parameters:
factory
- instance of factory to create the native object- Returns:
- the object instance.
-
setKey
public void setKey(String key)
Sets the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
key
- the key of the object to use to get data value from a tree object
-
setKey
public void setKey(Key key)
Sets the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
key
- the key of the object to use to get data value from a tree object
-
getKeyAsString
public String getKeyAsString()
Returns the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- the key of the object to use to get data value from a tree object
-
getKey
public Key getKey()
Returns the key of the object to use to get data value from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- the key of the object to use to get data value from a tree object
-
setTreeLeafKey
public void setTreeLeafKey(String key)
Sets the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.- Parameters:
key
- the name of the key where the object key of leaf node of tree object is stored.
-
setTreeLeafKey
public void setTreeLeafKey(Key key)
Sets the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.- Parameters:
key
- the name of the key where the object key of leaf node of tree object is stored.
-
getTreeLeafKeyAsString
public String getTreeLeafKeyAsString()
Returns the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.- Returns:
- the name of the key where the object key of leaf node of tree object is stored.
-
getTreeLeafKey
public Key getTreeLeafKey()
Returns the name of the key where the object key of leaf node of tree object is stored.
Used only when `tree` is an `object`, as hierarchical data.- Returns:
- the name of the key where the object key of leaf node of tree object is stored.
-
setSumKeys
public void setSumKeys(String... sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
sumKeys
- multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
-
setSumKeys
public void setSumKeys(Key... sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
sumKeys
- multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
-
setSumKeys
public void setSumKeys(Set<Key> sumKeys)
Sets multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
sumKeys
- multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
-
getSumKeysAsString
public Set<String> getSumKeysAsString()
Returns multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
-
getSumKeys
public Set<Key> getSumKeys()
Returns multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- multiple keys to add additional sums, on top of the `key` one, for scriptable options use.
-
setGroups
public void setGroups(String... groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
groups
- the keys of the object to use to group the values from a tree object
-
setGroups
public void setGroups(Key... groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
groups
- the keys of the object to use to group the values from a tree object
-
setGroups
public void setGroups(Set<Key> groups)
Sets the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Parameters:
groups
- the keys of the object to use to group the values from a tree object
-
getGroupsAsString
public Set<String> getGroupsAsString()
Returns the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- the keys of the object to use to group the values from a tree object
-
getGroups
public Set<Key> getGroups()
Returns the keys of the object to use to group the values from a tree object.
It's needed ONLY when tree data is set by a list of objects.- Returns:
- the keys of the object to use to group the values from a tree object
-
setSpacing
public void setSpacing(double spacing)
Sets the fixed spacing among rectangles.- Parameters:
spacing
- the fixed spacing among rectangles
-
getSpacing
public double getSpacing()
Returns the fixed spacing among rectangles.- Returns:
- the fixed spacing among rectangles
-
setRtl
public void setRtl(boolean rtl)
Setstrue
for rendering the rectangles from right to left.- Parameters:
rtl
-true
for rendering the rectangles from right to left
-
isRtl
public boolean isRtl()
Returnstrue
for rendering the rectangles from right to left.- Returns:
true
for rendering the rectangles from right to left.
-
setBorderRadius
public void setBorderRadius(int radius)
Sets the border radius.- Parameters:
radius
- the border radius.
-
setBorderRadius
public void setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).- Parameters:
borderRadius
- the border radius (in pixels).
-
getBorderRadiusAsObject
public BarBorderRadius getBorderRadiusAsObject()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
setData
public void setData(double... values)
Throws an exception because not available.
-
getBorderRadiusCallback
public BorderRadiusCallback<DatasetContext> getBorderRadiusCallback()
Returns the border radius callback, if set, otherwisenull
.- Returns:
- the border radius callback, if set, otherwise
null
.
-
setBorderRadius
public void setBorderRadius(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
Sets the border radius callback.- Parameters:
borderRadiusCallback
- the border radius callback.
-
setBorderRadius
public void setBorderRadius(NativeCallback borderRadiusCallback)
Sets the border radius callback.- Parameters:
borderRadiusCallback
- the border radius callback.
-
-