Package org.zkoss.chart.plotOptions
Class PiePlotOptions
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.plotOptions.SeriesPlotOptions
-
- org.zkoss.chart.plotOptions.PiePlotOptions
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
- Direct Known Subclasses:
FunnelPlotOptions
,SunburstPlotOptions
,VariablePiePlotOptions
public class PiePlotOptions extends SeriesPlotOptions
An option for pie plotAll the options in this class support
DynamicalAttribute
.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description PiePlotOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getBorderColor()
Returns the color of the border surrounding each slice.Number
getBorderWidth()
Returns the width of the border surrounding each slice.List<String>
getCenter()
Returns the center of the pie chart relative to the plot area.List<Color>
getColors()
Returns a series specific or series type specific color set to use instead of the globalCharts.getColors()
.Number
getDepth()
Returns the thickness of a 3D pie chart.Number
getEndAngle()
Returns the end angle of the pie in degrees where 0 is top and 90 is right.Color
getFillColor()
If the total sum of the pie's values is 0, the series is represented as an empty circle.String
getInnerSize()
Returns the size of the inner diameter for the pie.Number
getMinSize()
Returns the minimum size for a pie in response to auto margins.Object
getSize()
Returns the diameter of the pie relative to the plot area.Number
getSlicedOffset()
Returns if a point is sliced, moved out from the center, how many pixels should it be moved?Number
getStartAngle()
Returns the start angle of the pie slices in degrees where 0 is top and 90 right.Number
getThickness()
Returns thickness describing the ring size for a donut type chart, overridinggetInnerSize()
.boolean
isIgnoreHiddenPoint()
Returns whether ignore the hidden point.boolean
isShowInLegend()
Returns whether to display this particular series or series type in the legend.boolean
isStickyTracking()
Returns sticky tracking of mouse events.protected DataLabels
newDataLabels()
Internal method for subclasses to provide specific type of data labels.void
setBorderColor(String color)
Sets the color of the border surrounding each slice.void
setBorderColor(Color color)
Sets the color of the border surrounding each slice.void
setBorderColor(LinearGradient color)
Sets the color of the border surrounding each slice.void
setBorderColor(RadialGradient color)
Sets the color of the border surrounding each slice.void
setBorderWidth(Number borderWidth)
Sets the width of the border surrounding each slice.void
setCenter(Object... center)
Sets the center of the pie chart relative to the plot area.void
setCenter(List<Object> center)
Sets the center of the pie chart relative to the plot area.void
setColors(String... source)
Sets a series specific or series type specific color set to use instead of the globalCharts.getColors()
.void
setColors(List<Color> colors)
Sets a series specific or series type specific color set to use instead of the globalCharts.getColors()
.void
setDepth(Number depth)
Sets the Returns the thickness of a 3D pie chart.void
setEndAngle(Number endAngle)
Sets the end angle of the pie in degrees where 0 is top and 90 is right.void
setFillColor(String fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle.void
setFillColor(Color fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle.void
setFillColor(LinearGradient fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle.void
setFillColor(RadialGradient fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle.void
setIgnoreHiddenPoint(boolean ignoreHiddenPoint)
Sets whether ignore the hidden point.void
setInnerSize(Number innerSize)
Sets the size of the inner diameter for the pie.void
setInnerSize(String innerSize)
Sets the size of the inner diameter for the pie.void
setMinSize(Number minSize)
Sets the minimum size for a pie in response to auto margins.void
setShowInLegend(boolean showInLegend)
Sets whether to display this particular series or series type in the legend.void
setSize(Number size)
Sets the diameter of the pie relative to the plot area.void
setSize(String size)
Sets the diameter of the pie relative to the plot area.void
setSlicedOffset(Number slicedOffset)
Sets if a point is sliced, moved out from the center, how many pixels should it be moved?void
setStartAngle(Number startAngle)
Sets the start angle of the pie slices in degrees where 0 is top and 90 right.void
setStickyTracking(boolean stickyTracking)
Sets sticky tracking of mouse events.void
setThickness(Number thickness)
Sets thickness describing the ring size for a donut type chart, overridinggetInnerSize()
.-
Methods inherited from class org.zkoss.chart.plotOptions.SeriesPlotOptions
addDataLabels, getAccessibility, getAnimation, getAnimationLimit, getBoostBlending, getBoostThreshold, getBorderRadius, getClassName, getColor, getColorAxis, getColorIndex, getColorKey, getConnectorWidth, getCropThreshold, getCursor, getCustom, getDashStyle, getDataLabels, getDataLabelsList, getDataSorting, getDescription, getDragDrop, getFindNearestPointBy, getGroupPadding, getId, getIndex, getKeys, getLabel, getLegendSymbol, getLinecap, getLineWidth, getLinkedTo, getMarker, getName, getNeckHeight, getNeckWidth, getNegativeColor, getOnPoint, getOpacity, getPointDescriptionFormatter, getPointInterval, getPointIntervalUnit, getPointPlacement, getPointStart, getStacking, getStates, getStep, getThreshold, getTooltip, getTurboThreshold, getZoneAxis, getZones, isAllowPointSelect, isAnimation, isCenterInCategory, isClip, isColorByPoint, isConnectEnds, isConnectNulls, isCrisp, isDataAsColumns, isEnableMouseTracking, isGetExtremesFromAll, isIncludeInDataExport, isRelativeXValue, isSelected, isShadow, isShowCheckbox, isSkipKeyboardNavigation, isSoftThreshold, isStacking, isVisible, setAccessibility, setAllowPointSelect, setAnimation, setAnimation, setAnimationLimit, setBoostBlending, setBoostThreshold, setBorderRadius, setBorderRadius, setCenterInCategory, setClassName, setClip, setColor, setColor, setColor, setColor, setColorAxis, setColorAxis, setColorAxis, setColorByPoint, setColorIndex, setColorKey, setConnectEnds, setConnectNulls, setConnectorWidth, setCrisp, setCropThreshold, setCursor, setCustom, setDashStyle, setDataAsColumns, setDataLabels, setDataLabels, setDataSorting, setDescription, setDragDrop, setEnableMouseTracking, setFindNearestPointBy, setGetExtremesFromAll, setGroupPadding, setId, setIncludeInDataExport, setIndex, setKeys, setLabel, setLegendSymbol, setLinecap, setLineWidth, setLinkedTo, setMarker, setName, setNeckHeight, setNeckWidth, setNegativeColor, setNegativeColor, setNegativeColor, setNegativeColor, setOnPoint, setOpacity, setPointDescriptionFormatter, setPointInterval, setPointIntervalUnit, setPointPlacement, setPointPlacement, setPointStart, setRelativeXValue, setSelected, setShadow, setShowCheckbox, setSkipKeyboardNavigation, setSoftThreshold, setStacking, setStacking, setStates, setStep, setThreshold, setTooltip, setTurboThreshold, setVisible, setWidth, setZoneAxis, setZones, setZones
-
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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.zkoss.chart.OptionDataListener
onChange
-
-
-
-
Method Detail
-
newDataLabels
protected DataLabels newDataLabels()
Description copied from class:SeriesPlotOptions
Internal method for subclasses to provide specific type of data labels.- Overrides:
newDataLabels
in classSeriesPlotOptions
-
getBorderColor
public Color getBorderColor()
Returns the color of the border surrounding each slice.Default: #FFFFFF
-
setBorderColor
public void setBorderColor(Color color)
Sets the color of the border surrounding each slice.
-
setBorderColor
public void setBorderColor(String color)
Sets the color of the border surrounding each slice.
-
setBorderColor
public void setBorderColor(LinearGradient color)
Sets the color of the border surrounding each slice.
-
setBorderColor
public void setBorderColor(RadialGradient color)
Sets the color of the border surrounding each slice.
-
getBorderWidth
public Number getBorderWidth()
Returns the width of the border surrounding each slice.Default: 1
- Overrides:
getBorderWidth
in classSeriesPlotOptions
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
Sets the width of the border surrounding each slice.- Overrides:
setBorderWidth
in classSeriesPlotOptions
-
getCenter
public List<String> getCenter()
Returns the center of the pie chart relative to the plot area. Can be percentages or pixel values. The default behavior is to center the pie so that all slices and data labels are within the plot area. As a consequence, the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the center should be explicitly set, for example to["50%", "50%"]
.
-
setCenter
public void setCenter(List<Object> center)
Sets the center of the pie chart relative to the plot area. Can be percentages or pixel values. The default behavior is to center the pie so that all slices and data labels are within the plot area. As a consequence, the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the center should be explicitly set, for example to["50%", "50%"]
.- Overrides:
setCenter
in classSeriesPlotOptions
-
setCenter
public void setCenter(Object... center)
Description copied from class:SeriesPlotOptions
Sets the center of the pie chart relative to the plot area. Can be percentages or pixel values. The default behaviour is to center the pie so that all slices and data labels are within the plot area. As a consequence, the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the center should be explicitly set, for example to ["50%", "50%"].- Overrides:
setCenter
in classSeriesPlotOptions
-
getColors
public List<Color> getColors()
Returns a series specific or series type specific color set to use instead of the globalCharts.getColors()
.
-
setColors
public void setColors(List<Color> colors)
Sets a series specific or series type specific color set to use instead of the globalCharts.getColors()
.
-
setColors
public void setColors(String... source)
Sets a series specific or series type specific color set to use instead of the globalCharts.getColors()
.
-
getDepth
public Number getDepth()
Returns the thickness of a 3D pie chart.Default: 0
- Overrides:
getDepth
in classSeriesPlotOptions
-
setDepth
public void setDepth(Number depth)
Sets the Returns the thickness of a 3D pie chart.- Overrides:
setDepth
in classSeriesPlotOptions
-
getEndAngle
public Number getEndAngle()
Returns the end angle of the pie in degrees where 0 is top and 90 is right.Defaults to
startAngle
plus 360.
-
setEndAngle
public void setEndAngle(Number endAngle)
Sets the end angle of the pie in degrees where 0 is top and 90 is right.Defaults to
startAngle
plus 360.
-
getFillColor
public Color getFillColor()
If the total sum of the pie's values is 0, the series is represented as an empty circle. The fillColor option defines the color of that circle. Use pie.borderWidth to set the border thickness.- Since:
- 7.2.1.0
-
setFillColor
public void setFillColor(Color fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle. The fillColor option defines the color of that circle. Use pie.borderWidth to set the border thickness.- Since:
- 7.2.1.0
-
setFillColor
public void setFillColor(String fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle. The fillColor option defines the color of that circle. Use pie.borderWidth to set the border thickness.- Since:
- 7.2.1.0
-
setFillColor
public void setFillColor(LinearGradient fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle. The fillColor option defines the color of that circle. Use pie.borderWidth to set the border thickness.- Since:
- 7.2.1.0
-
setFillColor
public void setFillColor(RadialGradient fillColor)
If the total sum of the pie's values is 0, the series is represented as an empty circle. The fillColor option defines the color of that circle. Use pie.borderWidth to set the border thickness.- Since:
- 7.2.1.0
-
isIgnoreHiddenPoint
public boolean isIgnoreHiddenPoint()
Returns whether ignore the hidden point.Equivalent to
Chart.isIgnoreHiddenSeries()
, this option tells whether the series shall be redrawn as if the hidden point werenull
.The default value true.
-
setIgnoreHiddenPoint
public void setIgnoreHiddenPoint(boolean ignoreHiddenPoint)
Sets whether ignore the hidden point.Equivalent to
Chart.isIgnoreHiddenSeries()
, this option tells whether the series shall be redrawn as if the hidden point werenull
.The default value true.
-
getInnerSize
public String getInnerSize()
Returns the size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or pixel value. Percentages are relative to the size of the plot area. Pixel values are given as integers.
-
setInnerSize
public void setInnerSize(String innerSize)
Sets the size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or pixel value. Percentages are relative to the size of the plot area. Pixel values are given as integers.
-
setInnerSize
public void setInnerSize(Number innerSize)
Sets the size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or pixel value. Percentages are relative to the size of the plot area. Pixel values are given as integers.
-
getMinSize
public Number getMinSize()
Returns the minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels in side the plot area, but only to this size.Default:
80
-
setMinSize
public void setMinSize(Number minSize)
Sets the minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels in side the plot area, but only to this size.Default:
80
-
isShowInLegend
public boolean isShowInLegend()
Returns whether to display this particular series or series type in the legend. Pies are not shown in the legend by default.- Overrides:
isShowInLegend
in classSeriesPlotOptions
-
setShowInLegend
public void setShowInLegend(boolean showInLegend)
Sets whether to display this particular series or series type in the legend. Pies are not shown in the legend by default.- Overrides:
setShowInLegend
in classSeriesPlotOptions
-
getSize
public Object getSize()
Returns the diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as integers. The default behavior is to scale to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example"75%"
.Default: null
-
setSize
public void setSize(String size)
Sets the diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as integers. The default behavior is to scale to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example"75%"
.
-
setSize
public void setSize(Number size)
Sets the diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as integers. The default behavior is to scale to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example"75%"
.
-
getSlicedOffset
public Number getSlicedOffset()
Returns if a point is sliced, moved out from the center, how many pixels should it be moved?Default: 10
-
setSlicedOffset
public void setSlicedOffset(Number slicedOffset)
Sets if a point is sliced, moved out from the center, how many pixels should it be moved?
-
getStartAngle
public Number getStartAngle()
Returns the start angle of the pie slices in degrees where 0 is top and 90 right.Default: 0
-
setStartAngle
public void setStartAngle(Number startAngle)
Sets the start angle of the pie slices in degrees where 0 is top and 90 right.
-
isStickyTracking
public boolean isStickyTracking()
Returns sticky tracking of mouse events. When true, themouseOut
event on a series isn't triggered until the mouse moves over another series, or out of the plot area. When false, themouseOut
event on a series is triggered when the mouse leaves the area around the series' graph or markers. This also implies the tooltip. WhenstickyTracking
is false andtooltip.shared
is false, the tooltip will be hidden when moving the mouse between series.Default: false
- Overrides:
isStickyTracking
in classSeriesPlotOptions
-
setStickyTracking
public void setStickyTracking(boolean stickyTracking)
Sets sticky tracking of mouse events. When true, themouseOut
event on a series isn't triggered until the mouse moves over another series, or out of the plot area. When false, themouseOut
event on a series is triggered when the mouse leaves the area around the series' graph or markers. This also implies the tooltip. WhenstickyTracking
is false andtooltip.shared
is false, the tooltip will be hidden when moving the mouse between series.- Overrides:
setStickyTracking
in classSeriesPlotOptions
-
getThickness
public Number getThickness()
Returns thickness describing the ring size for a donut type chart, overridinggetInnerSize()
.Default:
null
- Since:
- 10.2.1.0
-
setThickness
public void setThickness(Number thickness)
Sets thickness describing the ring size for a donut type chart, overridinggetInnerSize()
.Default:
null
- Since:
- 10.2.1.0
-
-