Class TreeMapDataset

    • Field Detail

      • DATAPOINTS_FACTORY

        public static final org.pepstock.charba.client.treemap.TreeMapDataset.DataPointFactory DATAPOINTS_FACTORY
        Factory to create TreeMapDataPoints.
      • 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 class Dataset
        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 - if true 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 NativeObjectContainerList<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 NativeObjectContainerList<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 object
        binding - if true 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)
        Sets true for rendering the rectangles from right to left.
        Parameters:
        rtl - true for rendering the rectangles from right to left
      • isRtl

        public boolean isRtl()
        Returns true 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.
        Overrides:
        setData in class Dataset
        Parameters:
        values - ignored because will throw an exception
      • setData

        public void setData​(List<Double> values)
        Throws an exception because not available.
        Overrides:
        setData in class Dataset
        Parameters:
        values - ignored because will throw an exception
      • getData

        public List<Double> getData​(boolean binding)
        Throws an exception because not available.
        Overrides:
        getData in class Dataset
        Parameters:
        binding - ignored because will throw an exception
        Returns:
        nothing because will throw an exception
      • getBorderRadiusCallback

        public BorderRadiusCallback<DatasetContext> getBorderRadiusCallback()
        Returns the border radius callback, if set, otherwise null.
        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.