Package org.pepstock.charba.client.data
Class PieDataset
-
- All Implemented Interfaces:
HasCallbackScope
,HasDataset
,IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,HasAnimationOptions
- Direct Known Subclasses:
DoughnutDataset
public class PieDataset extends HoverDataset
The pie chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.data.Dataset
Dataset.CanvasObjectProperty, Dataset.CommonProperty
-
-
Field Summary
-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Modifier Constructor Description PieDataset()
Creates a dataset.
It uses the global options has default.PieDataset(boolean hidden)
Creates a dataset.
It uses the global options has default.PieDataset(IsDefaultOptions defaultValues)
Creates the dataset using a default.PieDataset(IsDefaultOptions defaultValues, boolean hidden)
Creates the dataset using a default.protected
PieDataset(Type type, boolean hidden)
Creates the dataset using chart type related to the dataset.protected
PieDataset(Type type, IsDefaultOptions defaultValues, boolean hidden)
Creates the dataset using a default and chart type related to the dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description default List<BorderAlign>
getBorderAlign()
Returns the property to set the border alignment on chart datasets.default BorderAlignCallback
getBorderAlignCallback()
Returns the border align callback, if set, otherwisenull
.org.pepstock.charba.client.data.BorderAlignHandler
getBorderAlignHandler()
List<Integer>
getBorderRadius()
Returns the list of arc border radius (in pixels).
If a callback has been set, returns an empty list.List<ArcBorderRadius>
getBorderRadiusAsObjects()
Returns the list of arc border radius objects.
If a callback or an array have been set, returns an empty object.BorderRadiusCallback<DatasetContext>
getBorderRadiusCallback()
Returns the border radius callback, if set, otherwisenull
.double
getCircumference()
Returns the sweep to allow arcs to cover.List<Integer>
getHoverOffset()
Returns the arc offset (in pixels), when dataset if hovered.OffsetCallback<DatasetContext>
getHoverOffsetCallback()
Returns the offset callback, when dataset is hovered, if set, otherwisenull
.List<Integer>
getOffset()
Returns the arc offset (in pixels).OffsetCallback<DatasetContext>
getOffsetCallback()
Returns the offset callback, if set, otherwisenull
.double
getRotation()
Returns the starting angle to draw arcs from.int
getSpacing()
Returns the fixed arc offset (in pixels).
Similar tooffset
but applies to all arcs.double
getWeight()
Returns the relative thickness of the dataset.
Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values.default void
setBorderAlign(List<BorderAlign> align)
Sets the property to set the border alignment on chart datasets.default void
setBorderAlign(BorderAlignCallback borderAlignCallback)
Sets the border align callback.default void
setBorderAlign(NativeCallback borderAlignCallback)
Sets the border align callback.default void
setBorderAlign(BorderAlign... align)
Sets the property to set the border alignment on chart datasets.void
setBorderRadius(int... borderRadius)
Sets the arc border radius (in pixels).void
setBorderRadius(List<ArcBorderRadius> borderRadius)
Sets the arc border radius objects.void
setBorderRadius(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
Sets the border radius callback.void
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the border radius callback.void
setBorderRadius(ArcBorderRadius... borderRadius)
Sets the arc border radius objects.void
setCircumference(double circumference)
Sets the sweep to allow arcs to cover.void
setHoverOffset(int... offset)
Sets the arc offset (in pixels), when dataset if hovered.void
setHoverOffset(NativeCallback hoverOffsetCallback)
Sets the offset callback, when dataset is hovered.void
setHoverOffset(OffsetCallback<DatasetContext> hoverOffsetCallback)
Sets the offset callback, when dataset is hovered.void
setOffset(int... offset)
Sets the arc offset (in pixels).void
setOffset(NativeCallback offsetCallback)
Sets the offset callback.void
setOffset(OffsetCallback<DatasetContext> offsetCallback)
Sets the offset callback.void
setRotation(double rotation)
Sets the starting angle to draw arcs from.void
setSpacing(int spacing)
Sets the fixed arc offset (in pixels).
Similar tooffset
but applies to all arcs.void
setWeight(double weight)
Sets the relative thickness of the dataset.
Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values.-
Methods inherited from class org.pepstock.charba.client.data.HoverDataset
getBorderWidthCallback, getColors, getHoverBackgroundColorAsGradient, getHoverBackgroundColorAsPatterns, getHoverBackgroundColorAsString, getHoverBorderColorAsGradient, getHoverBorderColorAsString, getHoverBorderWidth, getHoverBorderWidthCallback, getWidths, setBorderWidth, setBorderWidth, setColors, setColors, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderWidth, setWidths
-
Methods inherited from class org.pepstock.charba.client.data.HoverFlexDataset
getBackgroundColor, getBackgroundColorAsGradient, getBackgroundColorAsPatterns, getBackgroundColorAsString, getBorderColor, getBorderColorAsGradient, getBorderColorAsString, getBorderWidth, getHoverBackgroundColor, getHoverBorderColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderWidth, setHoverBorderWidth
-
Methods inherited from class org.pepstock.charba.client.data.Dataset
createContext, getAnimationContainer, getBackgroundColorCallback, getBorderColorCallback, getClip, getClipAsObject, getData, getData, getDataCount, getDataset, getDataType, getDefaultBackgroundColorAsString, getDefaultBorderColorAsString, getDefaultBorderWidth, getDefaultHoverBackgroundColorAsString, getDefaultHoverBorderColorAsString, getDefaultHoverBorderWidth, getDefaultValues, getHoverBackgroundColorCallback, getHoverBorderColorCallback, getId, getLabel, getOptions, getOptions, getScope, getType, getTypedDataset, hasOptions, invokeColorCallback, isClip, isHidden, isNormalized, isParsing, removeOptions, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setClip, setClip, setClip, setData, setData, setHidden, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setLabel, setNormalized, setOptions, setOptions, setParsing
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasAnimationOptions
getAnimation, getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
-
-
-
-
Constructor Detail
-
PieDataset
public PieDataset()
Creates a dataset.
It uses the global options has default.
-
PieDataset
public PieDataset(boolean hidden)
Creates a dataset.
It uses the global options has default.- Parameters:
hidden
- iftrue
, it will be initially hidden.
-
PieDataset
public PieDataset(IsDefaultOptions defaultValues)
Creates the dataset using a default.- Parameters:
defaultValues
- default options
-
PieDataset
public PieDataset(IsDefaultOptions defaultValues, boolean hidden)
Creates the dataset using a default.- Parameters:
defaultValues
- default optionshidden
- iftrue
, it will be initially hidden.
-
PieDataset
protected PieDataset(Type type, boolean hidden)
Creates the dataset using chart type related to the dataset.- Parameters:
type
- chart type related to the datasethidden
- iftrue
, it will be initially hidden.
-
PieDataset
protected PieDataset(Type type, IsDefaultOptions defaultValues, boolean hidden)
Creates the dataset using a default and chart type related to the dataset.- Parameters:
type
- chart type related to the datasetdefaultValues
- default optionshidden
- iftrue
, it will be initially hidden.
-
-
Method Detail
-
getBorderAlignHandler
public final org.pepstock.charba.client.data.BorderAlignHandler getBorderAlignHandler()
-
setRotation
public void setRotation(double rotation)
Sets the starting angle to draw arcs from.- Parameters:
rotation
- starting angle to draw arcs from.
-
getRotation
public double getRotation()
Returns the starting angle to draw arcs from.- Returns:
- starting angle to draw arcs from.
-
setSpacing
public void setSpacing(int spacing)
Sets the fixed arc offset (in pixels).
Similar tooffset
but applies to all arcs.- Parameters:
spacing
- the fixed arc offset (in pixels)
-
getSpacing
public int getSpacing()
Returns the fixed arc offset (in pixels).
Similar tooffset
but applies to all arcs.- Returns:
- the fixed arc offset (in pixels)
-
setCircumference
public void setCircumference(double circumference)
Sets the sweep to allow arcs to cover.- Parameters:
circumference
- the sweep to allow arcs to cover.
-
getCircumference
public double getCircumference()
Returns the sweep to allow arcs to cover.- Returns:
- the sweep to allow arcs to cover.
-
setWeight
public void setWeight(double weight)
Sets the relative thickness of the dataset.
Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values.- Parameters:
weight
- the relative thickness of the dataset
-
getWeight
public double getWeight()
Returns the relative thickness of the dataset.
Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values.- Returns:
- the relative thickness of the dataset
-
setOffset
public void setOffset(int... offset)
Sets the arc offset (in pixels).- Parameters:
offset
- the arc offset
-
getOffset
public List<Integer> getOffset()
Returns the arc offset (in pixels).- Returns:
- the arc offset
-
setHoverOffset
public void setHoverOffset(int... offset)
Sets the arc offset (in pixels), when dataset if hovered.- Parameters:
offset
- the arc offset, when dataset if hovered
-
getHoverOffset
public List<Integer> getHoverOffset()
Returns the arc offset (in pixels), when dataset if hovered.- Returns:
- the arc offset, when dataset if hovered
-
setBorderRadius
public void setBorderRadius(int... borderRadius)
Sets the arc border radius (in pixels).- Parameters:
borderRadius
- the arc border radius (in pixels).
-
setBorderRadius
public void setBorderRadius(ArcBorderRadius... borderRadius)
Sets the arc border radius objects.- Parameters:
borderRadius
- the arc border radius objects.
-
setBorderRadius
public void setBorderRadius(List<ArcBorderRadius> borderRadius)
Sets the arc border radius objects.- Parameters:
borderRadius
- the arc border radius objects.
-
getBorderRadius
public List<Integer> getBorderRadius()
Returns the list of arc border radius (in pixels).
If a callback has been set, returns an empty list.- Returns:
- the list of arc border radius (in pixels).
If a callback has been set, returns an empty list
-
getBorderRadiusAsObjects
public List<ArcBorderRadius> getBorderRadiusAsObjects()
Returns the list of arc border radius objects.
If a callback or an array have been set, returns an empty object.- Returns:
- the list of arc border radius objects.
If a callback or an array have been set, returns an empty object
-
getOffsetCallback
public OffsetCallback<DatasetContext> getOffsetCallback()
Returns the offset callback, if set, otherwisenull
.- Returns:
- the offset callback, if set, otherwise
null
.
-
setOffset
public void setOffset(OffsetCallback<DatasetContext> offsetCallback)
Sets the offset callback.- Parameters:
offsetCallback
- the offset callback.
-
setOffset
public void setOffset(NativeCallback offsetCallback)
Sets the offset callback.- Parameters:
offsetCallback
- the offset callback.
-
getHoverOffsetCallback
public OffsetCallback<DatasetContext> getHoverOffsetCallback()
Returns the offset callback, when dataset is hovered, if set, otherwisenull
.- Returns:
- the offset callback, when dataset is hovered, if set, otherwise
null
.
-
setHoverOffset
public void setHoverOffset(OffsetCallback<DatasetContext> hoverOffsetCallback)
Sets the offset callback, when dataset is hovered.- Parameters:
hoverOffsetCallback
- the offset callback, when dataset is hovered.
-
setHoverOffset
public void setHoverOffset(NativeCallback hoverOffsetCallback)
Sets the offset callback, when dataset is hovered.- Parameters:
hoverOffsetCallback
- the offset callback, when dataset is hovered.
-
getBorderRadiusCallback
public BorderRadiusCallback<DatasetContext> getBorderRadiusCallback()
Returns the border radius callback, if set, otherwisenull
.- 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.
-
setBorderAlign
public default void setBorderAlign(BorderAlign... align)
Sets the property to set the border alignment on chart datasets.- Parameters:
align
- the property to set the border alignment on chart datasets
-
setBorderAlign
public default void setBorderAlign(List<BorderAlign> align)
Sets the property to set the border alignment on chart datasets.- Parameters:
align
- the property to set the border alignment on chart datasets
-
getBorderAlign
public default List<BorderAlign> getBorderAlign()
Returns the property to set the border alignment on chart datasets.- Returns:
- the property to set the border alignment on chart datasets.
-
getBorderAlignCallback
public default BorderAlignCallback getBorderAlignCallback()
Returns the border align callback, if set, otherwisenull
.- Returns:
- the border align callback, if set, otherwise
null
.
-
setBorderAlign
public default void setBorderAlign(BorderAlignCallback borderAlignCallback)
Sets the border align callback.- Parameters:
borderAlignCallback
- the border align callback to set
-
setBorderAlign
public default void setBorderAlign(NativeCallback borderAlignCallback)
Sets the border align callback.- Parameters:
borderAlignCallback
- the border align callback to set
-
-