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.DataPointFactoryDATAPOINTS_FACTORYFactory to createTreeMapDataPoints.static intDEFAULT_BORDER_WIDTHDefault border width, 0.static booleanDEFAULT_RTLDefault right-to-left, false.static doubleDEFAULT_SPACINGDefault spacing, 0.5.-
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 CaptionsgetCaptions()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 intgetDefaultBorderWidth()Returns the default border width value based on type of chart.DividersgetDividers()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.KeygetKey()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.StringgetKeyAsString()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.LabelsgetLabels()Returns the labels object.doublegetSpacing()Returns the fixed spacing among rectangles.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.<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.booleanisRtl()Returnstruefor rendering the rectangles from right to left.voidsetData(double... values)Throws an exception because not available.voidsetData(List<Double> values)Throws an exception because not available.voidsetGroups(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.voidsetGroups(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.voidsetGroups(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.voidsetKey(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.voidsetKey(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.voidsetRtl(boolean rtl)Setstruefor rendering the rectangles from right to left.voidsetSpacing(double spacing)Sets the fixed spacing among rectangles.voidsetTree(double... values)Sets the tree data property of a data set for a chart is specified as an array of numbers.voidsetTree(List<Double> values)Sets the tree data property of a data set for a chart is specified as a list of numbers.<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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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
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, 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 createTreeMapDataPoints.
-
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_RTL
public static final boolean DEFAULT_RTL
Default right-to-left, false.- 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:DatasetReturns the default border width value based on type of chart.- Overrides:
getDefaultBorderWidthin 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- iftruebinds 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- iftruebinds the new array list in the container- Returns:
- list of objects
-
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
-
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)
Setstruefor rendering the rectangles from right to left.- Parameters:
rtl-truefor rendering the rectangles from right to left
-
isRtl
public boolean isRtl()
Returnstruefor rendering the rectangles from right to left.- Returns:
truefor rendering the rectangles from right to left.
-
setData
public void setData(double... values)
Throws an exception because not available.
-
-