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 class
BubbleLegend.Labels
Options for the bubble legend labels.static class
BubbleLegend.Range
Options 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 Color
getBorderColor()
Returns the color of the ranges borders, can be also defined for an individual range.Number
getBorderWidth()
Returns the width of the ranges borders in pixels, can be also defined for an individual range.String
getClassName()
Returns an additional class name to apply to the bubble legend' circle graphical elements.Color
getColor()
Returns the main color of the bubble legend.String
getConnectorClassName()
Returns an additional class name to apply to the bubble legend's connector graphical elements.Color
getConnectorColor()
Returns the color of the connector, can be also defined for an individual range.Number
getConnectorDistance()
Returns the length of the connectors in pixels.Number
getConnectorWidth()
Returns the width of the connectors in pixels.BubbleLegend.Labels
getLabels()
Returns options for the bubble legend labels if any.Number
getLegendIndex()
Returns the position of the bubble legend in the legend.Number
getMaxSize()
Returns maximum bubble legend range size.Number
getMinSize()
Returns minimum bubble legend range size.List<BubbleLegend.Range>
getRanges()
Returns the options for specific range.String
getSizeBy()
Returns whether the bubble legend range value should be represented by the area or the width of the bubble.Number
getZIndex()
Returns the visual z index of the bubble legend.Number
getZThreshold()
Returns the z threshold.boolean
isEnabled()
Returns enable or disable the bubble legend.boolean
isSizeByAbsoluteValue()
When this is true, the absolute value of z determines the size of the bubble.void
setBorderColor(String color)
Sets the color of the ranges borders, can be also defined for an individual range.void
setBorderColor(Color color)
Sets the color of the ranges borders, can be also defined for an individual range.void
setBorderColor(LinearGradient color)
Sets the color of the ranges borders, can be also defined for an individual range.void
setBorderColor(RadialGradient color)
Sets the color of the ranges borders, can be also defined for an individual range.void
setBorderWidth(Number borderWidth)
Sets the width of the ranges borders in pixels, can be also defined for an individual range.void
setClassName(String className)
Sets an additional class name to apply to the bubble legend' circle graphical elements.void
setColor(String color)
Sets the main color of the bubble legend.void
setColor(Color color)
Sets the main color of the bubble legend.void
setColor(LinearGradient color)
Sets the main color of the bubble legend.void
setColor(RadialGradient color)
Sets the main color of the bubble legend.void
setConnectorClassName(String connectorClassName)
Sets an additional class name to apply to the bubble legend's connector graphical elements.void
setConnectorColor(String connectorColor)
Sets the color of the connector, can be also defined for an individual range.void
setConnectorColor(Color connectorColor)
Sets the color of the connector, can be also defined for an individual range.void
setConnectorColor(LinearGradient connectorColor)
Sets the color of the connector, can be also defined for an individual range.void
setConnectorColor(RadialGradient connectorColor)
Sets the color of the connector, can be also defined for an individual range.void
setConnectorDistance(Number connectorDistance)
Sets the length of the connectors in pixels.void
setConnectorWidth(Number connectorWidth)
Sets the width of the connectors in pixels.void
setEnabled(boolean enabled)
Sets enable or disable the bubble legend.void
setLabels(BubbleLegend.Labels labels)
Sets options for the bubble legend labels.void
setLegendIndex(Number legendIndex)
Sets the position of the bubble legend in the legend.void
setMaxSize(Number maxSize)
Sets maximum bubble legend range size.void
setMinSize(Number minSize)
Sets minimum bubble legend range size.void
setRanges(List<BubbleLegend.Range> ranges)
Sets the options for specific range.void
setRanges(BubbleLegend.Range... ranges)
Sets the options for specific range.void
setSizeBy(String sizeBy)
Sets whether the bubble legend range value should be represented by the area or the width of the bubble.void
setSizeByAbsoluteValue(boolean sizeByAbsoluteValue)
When this is true, the absolute value of z determines the size of the bubble.void
setZIndex(Number zIndex)
Sets the visual z index of the bubble legend.void
setZThreshold(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.
-
-