Package org.zkoss.chart
Class BubbleLegend
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBubbleLegend.LabelsOptions for the bubble legend labels.static classBubbleLegend.RangeOptions for specific range.
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description BubbleLegend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetBorderColor()Returns the color of the ranges borders, can be also defined for an individual range.NumbergetBorderWidth()Returns the width of the ranges borders in pixels, can be also defined for an individual range.StringgetClassName()Returns an additional class name to apply to the bubble legend' circle graphical elements.ColorgetColor()Returns the main color of the bubble legend.StringgetConnectorClassName()Returns an additional class name to apply to the bubble legend's connector graphical elements.ColorgetConnectorColor()Returns the color of the connector, can be also defined for an individual range.NumbergetConnectorDistance()Returns the length of the connectors in pixels.NumbergetConnectorWidth()Returns the width of the connectors in pixels.BubbleLegend.LabelsgetLabels()Returns options for the bubble legend labels if any.NumbergetLegendIndex()Returns the position of the bubble legend in the legend.NumbergetMaxSize()Returns maximum bubble legend range size.NumbergetMinSize()Returns minimum bubble legend range size.List<BubbleLegend.Range>getRanges()Returns the options for specific range.StringgetSizeBy()Returns whether the bubble legend range value should be represented by the area or the width of the bubble.NumbergetZIndex()Returns the visual z index of the bubble legend.NumbergetZThreshold()Returns the z threshold.booleanisEnabled()Returns enable or disable the bubble legend.booleanisSizeByAbsoluteValue()When this is true, the absolute value of z determines the size of the bubble.voidsetBorderColor(String color)Sets the color of the ranges borders, can be also defined for an individual range.voidsetBorderColor(Color color)Sets the color of the ranges borders, can be also defined for an individual range.voidsetBorderColor(LinearGradient color)Sets the color of the ranges borders, can be also defined for an individual range.voidsetBorderColor(RadialGradient color)Sets the color of the ranges borders, can be also defined for an individual range.voidsetBorderWidth(Number borderWidth)Sets the width of the ranges borders in pixels, can be also defined for an individual range.voidsetClassName(String className)Sets an additional class name to apply to the bubble legend' circle graphical elements.voidsetColor(String color)Sets the main color of the bubble legend.voidsetColor(Color color)Sets the main color of the bubble legend.voidsetColor(LinearGradient color)Sets the main color of the bubble legend.voidsetColor(RadialGradient color)Sets the main color of the bubble legend.voidsetConnectorClassName(String connectorClassName)Sets an additional class name to apply to the bubble legend's connector graphical elements.voidsetConnectorColor(String connectorColor)Sets the color of the connector, can be also defined for an individual range.voidsetConnectorColor(Color connectorColor)Sets the color of the connector, can be also defined for an individual range.voidsetConnectorColor(LinearGradient connectorColor)Sets the color of the connector, can be also defined for an individual range.voidsetConnectorColor(RadialGradient connectorColor)Sets the color of the connector, can be also defined for an individual range.voidsetConnectorDistance(Number connectorDistance)Sets the length of the connectors in pixels.voidsetConnectorWidth(Number connectorWidth)Sets the width of the connectors in pixels.voidsetEnabled(boolean enabled)Sets enable or disable the bubble legend.voidsetLabels(BubbleLegend.Labels labels)Sets options for the bubble legend labels.voidsetLegendIndex(Number legendIndex)Sets the position of the bubble legend in the legend.voidsetMaxSize(Number maxSize)Sets maximum bubble legend range size.voidsetMinSize(Number minSize)Sets minimum bubble legend range size.voidsetRanges(List<BubbleLegend.Range> ranges)Sets the options for specific range.voidsetRanges(BubbleLegend.Range... ranges)Sets the options for specific range.voidsetSizeBy(String sizeBy)Sets whether the bubble legend range value should be represented by the area or the width of the bubble.voidsetSizeByAbsoluteValue(boolean sizeByAbsoluteValue)When this is true, the absolute value of z determines the size of the bubble.voidsetZIndex(Number zIndex)Sets the visual z index of the bubble legend.voidsetZThreshold(Number zThreshold)Sets the z threshold.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
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.
-
-