Class BubbleLegend

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware

    public class BubbleLegend
    extends Optionable
    The bubble legend is an additional element in legend which presents the scale of the bubble series. Individual bubble ranges can be defined by user or calculated from series. In the case of automatically calculated ranges, a 1px margin of error is permitted.

    All the options in this class support DynamicalAttribute.

    Since:
    7.2.1.0
    Author:
    rudyhuang
    See Also:
    Serialized Form
    • Constructor Detail

      • BubbleLegend

        public BubbleLegend()
    • Method Detail

      • getBorderColor

        public Color getBorderColor()
        Returns the color of the ranges borders, can be also defined for an individual range.

        Default: null

      • setBorderColor

        public void setBorderColor​(Color color)
        Sets the color of the ranges borders, can be also defined for an individual range.
      • setBorderColor

        public void setBorderColor​(String color)
        Sets the color of the ranges borders, can be also defined for an individual range.
      • setBorderColor

        public void setBorderColor​(LinearGradient color)
        Sets the color of the ranges borders, can be also defined for an individual range.
      • setBorderColor

        public void setBorderColor​(RadialGradient color)
        Sets the color of the ranges borders, can be also defined for an individual range.
      • getBorderWidth

        public Number getBorderWidth()
        Returns the width of the ranges borders in pixels, can be also defined for an individual range.

        Default: 2

      • setBorderWidth

        public void setBorderWidth​(Number borderWidth)
        Sets the width of the ranges borders in pixels, can be also defined for an individual range.
      • getClassName

        public String getClassName()
        Returns an additional class name to apply to the bubble legend' circle graphical elements. This option does not replace default class names of the graphical element.

        Default: ""

      • setClassName

        public void setClassName​(String className)
        Sets an additional class name to apply to the bubble legend' circle graphical elements. This option does not replace default class names of the graphical element.
      • getColor

        public Color getColor()
        Returns the main color of the bubble legend. Applies to ranges, if individual color is not defined.

        Default: null

      • setColor

        public void setColor​(Color color)
        Sets the main color of the bubble legend. Applies to ranges, if individual color is not defined.
      • setColor

        public void setColor​(String color)
        Sets the main color of the bubble legend. Applies to ranges, if individual color is not defined.
      • setColor

        public void setColor​(LinearGradient color)
        Sets the main color of the bubble legend. Applies to ranges, if individual color is not defined.
      • setColor

        public void setColor​(RadialGradient color)
        Sets the main color of the bubble legend. Applies to ranges, if individual color is not defined.
      • getConnectorClassName

        public String getConnectorClassName()
        Returns an additional class name to apply to the bubble legend's connector graphical elements. This option does not replace default class names of the graphical element.

        Default: ""

      • setConnectorClassName

        public void setConnectorClassName​(String connectorClassName)
        Sets an additional class name to apply to the bubble legend's connector graphical elements. This option does not replace default class names of the graphical element.
      • getConnectorColor

        public Color getConnectorColor()
        Returns the color of the connector, can be also defined for an individual range.

        Default: null

      • setConnectorColor

        public void setConnectorColor​(Color connectorColor)
        Sets the color of the connector, can be also defined for an individual range.
      • setConnectorColor

        public void setConnectorColor​(String connectorColor)
        Sets the color of the connector, can be also defined for an individual range.
      • setConnectorColor

        public void setConnectorColor​(LinearGradient connectorColor)
        Sets the color of the connector, can be also defined for an individual range.
      • setConnectorColor

        public void setConnectorColor​(RadialGradient connectorColor)
        Sets the color of the connector, can be also defined for an individual range.
      • getConnectorDistance

        public Number getConnectorDistance()
        Returns the length of the connectors in pixels. If labels are centered, the distance is reduced to 0.

        Default: 60

      • setConnectorDistance

        public void setConnectorDistance​(Number connectorDistance)
        Sets the length of the connectors in pixels. If labels are centered, the distance is reduced to 0.
      • getConnectorWidth

        public Number getConnectorWidth()
        Returns the width of the connectors in pixels.

        Default: 1

      • setConnectorWidth

        public void setConnectorWidth​(Number connectorWidth)
        Sets the width of the connectors in pixels.
      • isEnabled

        public boolean isEnabled()
        Returns enable or disable the bubble legend.

        Default: false

      • setEnabled

        public void setEnabled​(boolean enabled)
        Sets enable or disable the bubble legend.
      • getLabels

        public BubbleLegend.Labels getLabels()
        Returns options for the bubble legend labels if any. Otherwise, create a new one.
      • setLabels

        public void setLabels​(BubbleLegend.Labels labels)
        Sets options for the bubble legend labels.
      • getLegendIndex

        public Number getLegendIndex()
        Returns the position of the bubble legend in the legend.

        Default: 0

      • setLegendIndex

        public void setLegendIndex​(Number legendIndex)
        Sets the position of the bubble legend in the legend.
      • getMaxSize

        public Number getMaxSize()
        Returns maximum bubble legend range size. If values for ranges are not specified, the minSize and the maxSize are calculated from bubble series.

        Default: 60

      • setMaxSize

        public void setMaxSize​(Number maxSize)
        Sets maximum bubble legend range size. If values for ranges are not specified, the minSize and the maxSize are calculated from bubble series.
      • getMinSize

        public Number getMinSize()
        Returns minimum bubble legend range size. If values for ranges are not specified, the minSize and the maxSize are calculated from bubble series.

        Default: 10

      • setMinSize

        public void setMinSize​(Number minSize)
        Sets minimum bubble legend range size. If values for ranges are not specified, the minSize and the maxSize are calculated from bubble series.
      • getRanges

        public List<BubbleLegend.Range> getRanges()
        Returns the options for specific range. One range consists of bubble, label and connector.
      • setRanges

        public void setRanges​(List<BubbleLegend.Range> ranges)
        Sets the options for specific range. One range consists of bubble, label and connector.
      • setRanges

        public void setRanges​(BubbleLegend.Range... ranges)
        Sets the options for specific range. One range consists of bubble, label and connector.
      • getSizeBy

        public String getSizeBy()
        Returns whether the bubble legend range value should be represented by the area or the width of the bubble. The default, area, corresponds best to the human perception of the size of each bubble.

        Default: "area"

      • setSizeBy

        public void setSizeBy​(String sizeBy)
        Sets whether the bubble legend range value should be represented by the area or the width of the bubble. The default, area, corresponds best to the human perception of the size of each bubble.
      • isSizeByAbsoluteValue

        public boolean isSizeByAbsoluteValue()
        When this is true, the absolute value of z determines the size of the bubble. This means that with the default zThreshold of 0, a bubble of value -1 will have the same size as a bubble of value 1, while a bubble of value 0 will have a smaller size according to minSize.

        Default: false.

      • setSizeByAbsoluteValue

        public void setSizeByAbsoluteValue​(boolean sizeByAbsoluteValue)
        When this is true, the absolute value of z determines the size of the bubble. This means that with the default zThreshold of 0, a bubble of value -1 will have the same size as a bubble of value 1, while a bubble of value 0 will have a smaller size according to minSize.
      • getZIndex

        public Number getZIndex()
        Returns the visual z index of the bubble legend.

        Default: 1

      • setZIndex

        public void setZIndex​(Number zIndex)
        Sets the visual z index of the bubble legend.
      • getZThreshold

        public Number getZThreshold()
        Returns the z threshold. Ranges with with lower value than zThreshold, are skipped.

        Default: 0

      • setZThreshold

        public void setZThreshold​(Number zThreshold)
        Sets the z threshold. Ranges with with lower value than zThreshold, are skipped.