Class DataLabelsOptions
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.commons.AbstractNode
- 
- org.pepstock.charba.client.plugins.AbstractPluginOptions
- 
- org.pepstock.charba.client.datalabels.LabelItem
- 
- org.pepstock.charba.client.datalabels.DataLabelsOptions
 
 
 
 
 
- 
- All Implemented Interfaces:
- IsDefaultEventHandler,- HasEvents,- IsScriptableFontProvider<DataLabelsContext>,- IsScriptablePaddingProvider<DataLabelsContext>
 
 public final class DataLabelsOptions extends LabelItem This is theDataLabelsPlugin.IDplugin options where to set all the configuration needed to the plugin.
 The options could be set by simply the value or by setting a callback.
 TheDataLabelsPlugin.IDplugin is highly customizable CHART.JS plugin that displays labels on data for any type of charts.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Field SummaryFields Modifier and Type Field Description static AlignDEFAULT_ALIGNDefault position of the label relative to the anchor point position and orientation,Align.CENTER.static AnchorDEFAULT_ANCHORDefault anchor point, which is defined by an orientation vector and a position on the data element,Anchor.CENTER.static StringDEFAULT_BACKGROUND_COLORDefault background color,null, and uses the background color of dataset.static StringDEFAULT_BORDER_COLORDefault border color,null, and uses the border color of dataset.static doubleDEFAULT_BORDER_RADIUSDefault border radius of labels, 0.0.static intDEFAULT_BORDER_WIDTHDefault border width of labels, 0.static booleanDEFAULT_CLAMPDefault to enforce the anchor position to be calculated based on the visible geometry of the associated element, false.static booleanDEFAULT_CLIPDefault to enforce the part of the label which is outside the chart area will be masked, false.static DisplayDEFAULT_DISPLAYDefault visibility of labels,Display.TRUE.static intDEFAULT_OFFSETDefault distance (in pixels) to pull the label away from the anchor point, 4.static doubleDEFAULT_OPACITYDefault opacity, 1.0.static doubleDEFAULT_ROTATIONDefault clockwise rotation angle (in degrees) of the label, 0.0.static TextAlignDEFAULT_TEXT_ALIGNDefault text alignment being used when drawing the label text,TextAlign.START.static doubleDEFAULT_TEXT_SHADOW_BLURDefault text shadow blur, 0.0.static intDEFAULT_TEXT_STROKE_WIDTHDefault text stroke width, 0.
 - 
Constructor SummaryConstructors Constructor Description DataLabelsOptions()Creates newDataLabelsPlugin.IDplugin options.DataLabelsOptions(IsChart chart)Creates newDataLabelsPlugin.IDplugin options, relating to chart instance for default.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Default Methods Modifier and Type Method Description protected voidapplyingDefaults()This is invoked before storing the plugins options as default.default AligngetAlign()Returns the position of the label relative to the anchor point position and orientation.default AlignCallbackgetAlignCallback()Returns the align callback.default AnchorgetAnchor()Returns the anchor point, which is defined by an orientation vector and a position on the data elementdefault AnchorCallbackgetAnchorCallback()Returns the anchor callback.default StringgetBackgroundColorAsString()Returns the background color as string.default ColorCallback<DataLabelsContext>getBackgroundColorCallback()Returns the background color callback.default StringgetBorderColorAsString()Returns the border color as string.default ColorCallback<DataLabelsContext>getBorderColorCallback()Returns the border color callback.default doublegetBorderRadius()Returns the border radius.default RadiusCallback<DataLabelsContext>getBorderRadiusCallback()Returns the border radius callback.default intgetBorderWidth()Returns the border width.default WidthCallback<DataLabelsContext>getBorderWidthCallback()Returns the border width callback.default ClampCallbackgetClampCallback()Returns the clamp callback.default ClipCallbackgetClipCallback()Returns the clip callback.default StringgetColorAsString()Returns the color as string.default ColorCallback<DataLabelsContext>getColorCallback()Returns the color callback.default DisplaygetDisplay()Returns the visibility of labels.default DisplayCallback<DataLabelsContext>getDisplayCallback()Returns the display callback.IsDefaultFontgetFont()Returns the font element.default FontCallback<DataLabelsContext>getFontCallback()Returns the font callback.default FormatterCallbackgetFormatterCallback()Returns the formatter callback.LabelsgetLabels()Returns the labels element.org.pepstock.charba.client.datalabels.IsDefaultListenersgetListeners()Returns the listeners element.default intgetOffset()Returns the distance (in pixels) to pull the label away from the anchor point.default OffsetCallback<DataLabelsContext>getOffsetCallback()Returns the offset callback.default doublegetOpacity()Returns the opacity.default OpacityCallbackgetOpacityCallback()Returns the opacity callback.IsDefaultPaddinggetPadding()Returns the padding element.default PaddingCallback<DataLabelsContext>getPaddingCallback()Returns the padding callback.default doublegetRotation()Returns the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.default RotationCallback<DataLabelsContext>getRotationCallback()Returns the rotation callback.default TextAligngetTextAlign()Returns the text alignment being used when drawing the label text.default TextAlignCallback<DataLabelsContext>getTextAlignCallback()Returns the text align callback.default doublegetTextShadowBlur()Returns the text shadow blur.default TextShadowBlurCallbackgetTextShadowBlurCallback()Returns the text shadow blur callback.default StringgetTextShadowColorAsString()Returns the text shadow color as string.default ColorCallback<DataLabelsContext>getTextShadowColorCallback()Returns the text shadow color callback.default StringgetTextStrokeColorAsString()Returns the text stroke color as string.default ColorCallback<DataLabelsContext>getTextStrokeColorCallback()Returns the text stroke color callback.default intgetTextStrokeWidth()Returns the text stroke width.default WidthCallback<DataLabelsContext>getTextStrokeWidthCallback()Returns the text stroke width callback.default booleanisClamp()Returnstrueto enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e.default booleanisClip()When the clip option istrue, the part of the label which is outside the chart area will be masked.- 
Methods inherited from class org.pepstock.charba.client.datalabels.LabelItemgetAlign, getAlignCallback, getAlignDegrees, getAnchor, getAnchorCallback, getBackgroundColor, getBackgroundColorAsString, getBackgroundColorCallback, getBorderColor, getBorderColorAsString, getBorderColorCallback, getBorderRadius, getBorderRadiusCallback, getBorderWidth, getBorderWidthCallback, getClampCallback, getClipCallback, getColor, getColorAsString, getColorCallback, getDisplay, getDisplayCallback, getFont, getFontCallback, getFormatterCallback, getListeners, getOffset, getOffsetCallback, getOpacity, getOpacityCallback, getPadding, getPaddingCallback, getRotation, getRotationCallback, getTextAlign, getTextAlignCallback, getTextShadowBlur, getTextShadowBlurCallback, getTextShadowColor, getTextShadowColorAsString, getTextShadowColorCallback, getTextStrokeColor, getTextStrokeColorAsString, getTextStrokeColorCallback, getTextStrokeWidth, getTextStrokeWidthCallback, isClamp, isClip, setAlign, setAlign, setAlign, setAlign, setAnchor, setAnchor, setAnchor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderRadius, setBorderRadius, setBorderRadius, setBorderWidth, setBorderWidth, setBorderWidth, setClamp, setClamp, setClamp, setClip, setClip, setClip, setColor, setColor, setColor, setColor, setDisplay, setDisplay, setDisplay, setDisplay, setFont, setFont, setFormatter, setListenersHandler, setOffset, setOffset, setOffset, setOpacity, setOpacity, setOpacity, setPadding, setPadding, setRotation, setRotation, setRotation, setTextAlign, setTextAlign, setTextAlign, setTextShadowBlur, setTextShadowBlur, setTextShadowBlur, setTextShadowColor, setTextShadowColor, setTextShadowColor, setTextShadowColor, setTextStrokeColor, setTextStrokeColor, setTextStrokeColor, setTextStrokeColor, setTextStrokeWidth, setTextStrokeWidth, setTextStrokeWidth
 - 
Methods inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptionsapplyingDefaults, getEventsOptionHandler, getId, getPluginId, loadGlobalsPluginOptions, store, store, store, store
 - 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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.NativeObjectContainercheckAndGetColor, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_ALIGNpublic static final Align DEFAULT_ALIGN Default position of the label relative to the anchor point position and orientation,Align.CENTER.
 - 
DEFAULT_ANCHORpublic static final Anchor DEFAULT_ANCHOR Default anchor point, which is defined by an orientation vector and a position on the data element,Anchor.CENTER.
 - 
DEFAULT_BACKGROUND_COLORpublic static final String DEFAULT_BACKGROUND_COLOR Default background color,null, and uses the background color of dataset.
 - 
DEFAULT_BORDER_COLORpublic static final String DEFAULT_BORDER_COLOR Default border color,null, and uses the border color of dataset.
 - 
DEFAULT_BORDER_RADIUSpublic static final double DEFAULT_BORDER_RADIUS Default border radius of labels, 0.0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_BORDER_WIDTHpublic static final int DEFAULT_BORDER_WIDTH Default border width of labels, 0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_CLAMPpublic static final boolean DEFAULT_CLAMP Default to enforce the anchor position to be calculated based on the visible geometry of the associated element, false.- See Also:
- Constant Field Values
 
 - 
DEFAULT_CLIPpublic static final boolean DEFAULT_CLIP Default to enforce the part of the label which is outside the chart area will be masked, false.- See Also:
- Constant Field Values
 
 - 
DEFAULT_DISPLAYpublic static final Display DEFAULT_DISPLAY Default visibility of labels,Display.TRUE.
 - 
DEFAULT_OFFSETpublic static final int DEFAULT_OFFSET Default distance (in pixels) to pull the label away from the anchor point, 4.- See Also:
- Constant Field Values
 
 - 
DEFAULT_OPACITYpublic static final double DEFAULT_OPACITY Default opacity, 1.0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_ROTATIONpublic static final double DEFAULT_ROTATION Default clockwise rotation angle (in degrees) of the label, 0.0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_TEXT_ALIGNpublic static final TextAlign DEFAULT_TEXT_ALIGN Default text alignment being used when drawing the label text,TextAlign.START.
 - 
DEFAULT_TEXT_STROKE_WIDTHpublic static final int DEFAULT_TEXT_STROKE_WIDTH Default text stroke width, 0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_TEXT_SHADOW_BLURpublic static final double DEFAULT_TEXT_SHADOW_BLUR Default text shadow blur, 0.0.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
DataLabelsOptionspublic DataLabelsOptions() Creates newDataLabelsPlugin.IDplugin options.
 - 
DataLabelsOptionspublic DataLabelsOptions(IsChart chart) Creates newDataLabelsPlugin.IDplugin options, relating to chart instance for default.- Parameters:
- chart- chart instance related to the plugin options
 
 
- 
 - 
Method Detail- 
applyingDefaultsprotected void applyingDefaults() Description copied from class:AbstractPluginOptionsThis is invoked before storing the plugins options as default.- Overrides:
- applyingDefaultsin class- LabelItem
 
 - 
getLabelspublic Labels getLabels() Returns the labels element.- Returns:
- the labels element.
 
 - 
getFontpublic abstract IsDefaultFont getFont() Returns the font element.- Returns:
- the font element.
 
 - 
getPaddingpublic abstract IsDefaultPadding getPadding() Returns the padding element.- Returns:
- the padding element.
 
 - 
getListenerspublic abstract org.pepstock.charba.client.datalabels.IsDefaultListeners getListeners() Returns the listeners element.- Returns:
- the listeners element.
 
 - 
getAlignpublic default Align getAlign() Returns the position of the label relative to the anchor point position and orientation.- Returns:
- the position of the label relative to the anchor point position and orientation.
 
 - 
getAnchorpublic default Anchor getAnchor() Returns the anchor point, which is defined by an orientation vector and a position on the data element- Returns:
- the anchor point, which is defined by an orientation vector and a position on the data element.
 
 - 
getBackgroundColorAsStringpublic default String getBackgroundColorAsString() Returns the background color as string.- Returns:
- the background color as string. If null, it uses the background color of dataset.
 
 - 
getBorderColorAsStringpublic default String getBorderColorAsString() Returns the border color as string.- Returns:
- the border color as string. If null, it uses the border color of dataset.
 
 - 
getBorderRadiuspublic default double getBorderRadius() Returns the border radius.- Returns:
- the border radius.
 
 - 
getBorderWidthpublic default int getBorderWidth() Returns the border width.- Returns:
- the border width.
 
 - 
isClamppublic default boolean isClamp() Returnstrueto enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).- Returns:
- trueto enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).
 
 - 
isClippublic default boolean isClip() When the clip option istrue, the part of the label which is outside the chart area will be masked.- Returns:
- when the clip option is true, the part of the label which is outside the chart area will be masked.
 
 - 
getColorAsStringpublic default String getColorAsString() Returns the color as string.- Returns:
- the color as string.
 
 - 
getDisplaypublic default Display getDisplay() Returns the visibility of labels.- Returns:
- the visibility of labels.
 
 - 
getOffsetpublic default int getOffset() Returns the distance (in pixels) to pull the label away from the anchor point. This option is not applicable when align is 'center'. Also note that if align is 'start', the label is moved in the opposite direction.- Returns:
- the distance (in pixels) to pull the label away from the anchor point. This option is not applicable when align is 'center'. Also note that if align is 'start', the label is moved in the opposite direction.
 
 - 
getOpacitypublic default double getOpacity() Returns the opacity.- Returns:
- the opacity.
 
 - 
getRotationpublic default double getRotation() Returns the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.- Returns:
- the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.
 
 - 
getTextAlignpublic default TextAlign getTextAlign() Returns the text alignment being used when drawing the label text.- Returns:
- the text alignment being used when drawing the label text.
 
 - 
getTextStrokeColorAsStringpublic default String getTextStrokeColorAsString() Returns the text stroke color as string.- Returns:
- the text stroke color as string.
 
 - 
getTextStrokeWidthpublic default int getTextStrokeWidth() Returns the text stroke width.- Returns:
- the text stroke width.
 
 - 
getTextShadowBlurpublic default double getTextShadowBlur() Returns the text shadow blur.- Returns:
- the text shadow blur.
 
 - 
getTextShadowColorAsStringpublic default String getTextShadowColorAsString() Returns the text shadow color as string.- Returns:
- the text shadow color as string.
 
 - 
getBackgroundColorCallbackpublic default ColorCallback<DataLabelsContext> getBackgroundColorCallback() Returns the background color callback.- Returns:
- the background color callback.
 
 - 
getBorderColorCallbackpublic default ColorCallback<DataLabelsContext> getBorderColorCallback() Returns the border color callback.- Returns:
- the border color callback.
 
 - 
getColorCallbackpublic default ColorCallback<DataLabelsContext> getColorCallback() Returns the color callback.- Returns:
- the color callback.
 
 - 
getFormatterCallbackpublic default FormatterCallback getFormatterCallback() Returns the formatter callback.- Returns:
- the formatter callback.
 
 - 
getAlignCallbackpublic default AlignCallback getAlignCallback() Returns the align callback.- Returns:
- the align callback.
 
 - 
getAnchorCallbackpublic default AnchorCallback getAnchorCallback() Returns the anchor callback.- Returns:
- the anchor callback.
 
 - 
getBorderRadiusCallbackpublic default RadiusCallback<DataLabelsContext> getBorderRadiusCallback() Returns the border radius callback.- Returns:
- the border radius callback.
 
 - 
getBorderWidthCallbackpublic default WidthCallback<DataLabelsContext> getBorderWidthCallback() Returns the border width callback.- Returns:
- the border width callback.
 
 - 
getClampCallbackpublic default ClampCallback getClampCallback() Returns the clamp callback.- Returns:
- the clamp callback.
 
 - 
getClipCallbackpublic default ClipCallback getClipCallback() Returns the clip callback.- Returns:
- the clip callback.
 
 - 
getDisplayCallbackpublic default DisplayCallback<DataLabelsContext> getDisplayCallback() Returns the display callback.- Returns:
- the display callback.
 
 - 
getOffsetCallbackpublic default OffsetCallback<DataLabelsContext> getOffsetCallback() Returns the offset callback.- Returns:
- the offset callback.
 
 - 
getOpacityCallbackpublic default OpacityCallback getOpacityCallback() Returns the opacity callback.- Returns:
- the opacity callback.
 
 - 
getRotationCallbackpublic default RotationCallback<DataLabelsContext> getRotationCallback() Returns the rotation callback.- Returns:
- the rotation callback.
 
 - 
getTextAlignCallbackpublic default TextAlignCallback<DataLabelsContext> getTextAlignCallback() Returns the text align callback.- Returns:
- the text align callback.
 
 - 
getTextStrokeColorCallbackpublic default ColorCallback<DataLabelsContext> getTextStrokeColorCallback() Returns the text stroke color callback.- Returns:
- the text stroke color callback.
 
 - 
getTextStrokeWidthCallbackpublic default WidthCallback<DataLabelsContext> getTextStrokeWidthCallback() Returns the text stroke width callback.- Returns:
- the text stroke width callback.
 
 - 
getTextShadowBlurCallbackpublic default TextShadowBlurCallback getTextShadowBlurCallback() Returns the text shadow blur callback.- Returns:
- the text shadow blur callback.
 
 - 
getTextShadowColorCallbackpublic default ColorCallback<DataLabelsContext> getTextShadowColorCallback() Returns the text shadow color callback.- Returns:
- the text shadow color callback.
 
 - 
getFontCallbackpublic default FontCallback<DataLabelsContext> getFontCallback() Returns the font callback.- Returns:
- the font callback.
 
 - 
getPaddingCallbackpublic default PaddingCallback<DataLabelsContext> getPaddingCallback() Returns the padding callback.- Returns:
- the padding callback.
 
 
- 
 
-