public class LabelItem extends AbstractPluginOptions implements IsScriptableFontProvider<DataLabelsContext>, IsScriptablePaddingProvider<DataLabelsContext>
DataLabelsPlugin.ID
plugin options where to set all the configuration needed to the a label.Modifier and Type | Method and Description |
---|---|
protected void |
applyingDefaults()
This is invoked before storing the plugins options as default.
|
Align |
getAlign()
Returns the position of the label relative to the anchor point position and orientation.
|
AlignCallback |
getAlignCallback()
Returns the align callback, if set, otherwise
null . |
double |
getAlignDegrees()
Returns the position of the label relative to the anchor point position and orientation, by a number representing the clockwise angle (in degree).
|
Anchor |
getAnchor()
Returns the anchor point, which is defined by an orientation vector and a position on the data element.
|
AnchorCallback |
getAnchorCallback()
Returns the anchor callback, if set, otherwise
null . |
IsColor |
getBackgroundColor()
Returns the background color.
|
String |
getBackgroundColorAsString()
Returns the background color as string.
|
ColorCallback<DataLabelsContext> |
getBackgroundColorCallback()
Returns the background color callback, if set, otherwise
null . |
IsColor |
getBorderColor()
Returns the border color.
|
String |
getBorderColorAsString()
Returns the border color as string.
|
ColorCallback<DataLabelsContext> |
getBorderColorCallback()
Returns the border color callback, if set, otherwise
null . |
double |
getBorderRadius()
Returns the border radius.
|
RadiusCallback<DataLabelsContext> |
getBorderRadiusCallback()
Returns the border radius callback, if set, otherwise
null . |
int |
getBorderWidth()
Returns the border width.
|
WidthCallback<DataLabelsContext> |
getBorderWidthCallback()
Returns the border width callback, if set, otherwise
null . |
ClampCallback |
getClampCallback()
Returns the clamp callback, if set, otherwise
null . |
ClipCallback |
getClipCallback()
Returns the clip callback, if set, otherwise
null . |
IsColor |
getColor()
Returns the color.
|
String |
getColorAsString()
Returns the color as string.
|
ColorCallback<DataLabelsContext> |
getColorCallback()
Returns the color callback, if set, otherwise
null . |
Display |
getDisplay()
Returns the visibility of labels.
|
DisplayCallback |
getDisplayCallback()
Returns the display callback, if set, otherwise
null . |
Font |
getFont()
Returns the font element.
|
FontCallback<DataLabelsContext> |
getFontCallback()
Returns the font callback, if set, otherwise
null . |
FormatterCallback |
getFormatterCallback()
Returns the formatter callback, if set, otherwise
null . |
Listeners |
getListeners()
Returns the listeners element.
|
int |
getOffset()
Returns the distance (in pixels) to pull the label away from the anchor point.
|
OffsetCallback<DataLabelsContext> |
getOffsetCallback()
Returns the offset callback, if set, otherwise
null . |
double |
getOpacity()
Returns the opacity.
|
OpacityCallback |
getOpacityCallback()
Returns the opacity callback, if set, otherwise
null . |
Padding |
getPadding()
Returns the padding element.
|
PaddingCallback<DataLabelsContext> |
getPaddingCallback()
Returns the padding callback, if set, otherwise
null . |
double |
getRotation()
Returns the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.
|
RotationCallback<DataLabelsContext> |
getRotationCallback()
Returns the rotation callback, if set, otherwise
null . |
TextAlign |
getTextAlign()
Returns the text alignment being used when drawing the label text when multiple lines.
|
TextAlignCallback<DataLabelsContext> |
getTextAlignCallback()
Returns the text align callback, if set, otherwise
null . |
double |
getTextShadowBlur()
Returns the text shadow blur.
|
TextShadowBlurCallback |
getTextShadowBlurCallback()
Returns the text shadow blur callback, if set, otherwise
null . |
IsColor |
getTextShadowColor()
Returns the text shadow color.
|
String |
getTextShadowColorAsString()
Returns the text shadow color as string.
|
ColorCallback<DataLabelsContext> |
getTextShadowColorCallback()
Returns the text shadow color callback, if set, otherwise
null . |
IsColor |
getTextStrokeColor()
Returns the text stroke color.
|
String |
getTextStrokeColorAsString()
Returns the text stroke color as string.
|
ColorCallback<DataLabelsContext> |
getTextStrokeColorCallback()
Returns the text stroke color callback, if set, otherwise
null . |
int |
getTextStrokeWidth()
Returns the text stroke width.
|
WidthCallback<DataLabelsContext> |
getTextStrokeWidthCallback()
Returns the text stroke width callback, if set, otherwise
null . |
boolean |
isClamp()
Returns
true to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. |
boolean |
isClip()
When the clip option is
true , the part of the label which is outside the chart area will be masked. |
void |
setAlign(Align align)
Sets the position of the label relative to the anchor point position and orientation.
|
void |
setAlign(AlignCallback alignCallback)
Sets the align callback.
|
void |
setAlign(double align)
Sets the position of the label relative to the anchor point position and orientation, by a number representing the clockwise angle (in degree).
|
void |
setAlign(NativeCallback alignCallback)
Sets the align callback.
|
void |
setAnchor(Anchor anchor)
Sets the anchor point, which is defined by an orientation vector and a position on the data element.
|
void |
setAnchor(AnchorCallback anchorCallback)
Sets the anchor callback.
|
void |
setAnchor(NativeCallback anchorCallback)
Sets the anchor callback.
|
void |
setBackgroundColor(ColorCallback<DataLabelsContext> backgroundColorCallback)
Sets the background color callback.
|
void |
setBackgroundColor(IsColor color)
Sets the background color.
|
void |
setBackgroundColor(NativeCallback backgroundColorCallback)
Sets the background color callback.
|
void |
setBackgroundColor(String color)
Sets the background color.
|
void |
setBorderColor(ColorCallback<DataLabelsContext> borderColorCallback)
Sets the border color callback.
|
void |
setBorderColor(IsColor color)
Sets the border color.
|
void |
setBorderColor(NativeCallback borderColorCallback)
Sets the border color callback.
|
void |
setBorderColor(String color)
Sets the border color.
|
void |
setBorderRadius(double radius)
Sets the border radius.
|
void |
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the border radius callback.
|
void |
setBorderRadius(RadiusCallback<DataLabelsContext> borderRadiusCallback)
Sets the border radius callback.
|
void |
setBorderWidth(int width)
Sets the border width.
|
void |
setBorderWidth(NativeCallback borderWidthCallback)
Sets the border width callback.
|
void |
setBorderWidth(WidthCallback<DataLabelsContext> borderWidthCallback)
Sets the border width callback.
|
void |
setClamp(boolean clamp)
Sets
true to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. |
void |
setClamp(ClampCallback clampCallback)
Sets the clamp callback.
|
void |
setClamp(NativeCallback clampCallback)
Sets the clamp callback.
|
void |
setClip(boolean clip)
When the clip option is
true , the part of the label which is outside the chart area will be masked. |
void |
setClip(ClipCallback clipCallback)
Sets the clip callback.
|
void |
setClip(NativeCallback clipCallback)
Sets the clip callback.
|
void |
setColor(ColorCallback<DataLabelsContext> colorCallback)
Sets the color callback.
|
void |
setColor(IsColor color)
Sets the color.
|
void |
setColor(NativeCallback colorCallback)
Sets the color callback.
|
void |
setColor(String color)
Sets the color.
|
void |
setDisplay(boolean display)
Sets the visibility of labels.
|
void |
setDisplay(Display display)
Sets the visibility of labels.
|
void |
setDisplay(DisplayCallback displayCallback)
Sets the display callback.
|
void |
setDisplay(NativeCallback displayCallback)
Sets the display callback.
|
void |
setFont(FontCallback<DataLabelsContext> fontCallback)
Sets the the font callback.
|
void |
setFont(NativeCallback fontCallback)
Sets the the font callback.
|
void |
setFormatter(FormatterCallback formatterCallback)
Sets the formatter callback.
|
void |
setListenersHandler(AbstractEventHandler handler)
Adds a event handler instance as listener for all events.
|
void |
setOffset(int offset)
Sets the distance (in pixels) to pull the label away from the anchor point.
|
void |
setOffset(NativeCallback offsetCallback)
Sets the offset callback.
|
void |
setOffset(OffsetCallback<DataLabelsContext> offsetCallback)
Sets the offset callback.
|
void |
setOpacity(double opacity)
Sets the opacity.
|
void |
setOpacity(NativeCallback opacityCallback)
Sets the opacity callback.
|
void |
setOpacity(OpacityCallback opacityCallback)
Sets the opacity callback.
|
void |
setPadding(NativeCallback paddingCallback)
Sets the padding callback.
|
void |
setPadding(PaddingCallback<DataLabelsContext> paddingCallback)
Sets the padding callback.
|
void |
setRotation(double rotation)
Sets the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.
|
void |
setRotation(NativeCallback rotationCallback)
Sets the rotation callback.
|
void |
setRotation(RotationCallback<DataLabelsContext> rotationCallback)
Sets the rotation callback.
|
void |
setTextAlign(NativeCallback textAlignCallback)
Sets the text align callback.
|
void |
setTextAlign(TextAlign textAlign)
Sets the text alignment being used when drawing the label text when multiple lines.
|
void |
setTextAlign(TextAlignCallback<DataLabelsContext> textAlignCallback)
Sets the text align callback.
|
void |
setTextShadowBlur(double textShadowBlur)
Sets the text shadow blur.
|
void |
setTextShadowBlur(NativeCallback textShadowBlurCallback)
Sets the text shadow blur callback.
|
void |
setTextShadowBlur(TextShadowBlurCallback textShadowBlurCallback)
Sets the text shadow blur callback.
|
void |
setTextShadowColor(ColorCallback<DataLabelsContext> textShadowColorCallback)
Sets the text shadow color callback.
|
void |
setTextShadowColor(IsColor color)
Sets the text shadow color color.
|
void |
setTextShadowColor(NativeCallback textShadowColorCallback)
Sets the text shadow color callback.
|
void |
setTextShadowColor(String color)
Sets the text shadow color color.
|
void |
setTextStrokeColor(ColorCallback<DataLabelsContext> textStrokeColorCallback)
Sets the text stroke color callback.
|
void |
setTextStrokeColor(IsColor color)
Sets the text stroke color.
|
void |
setTextStrokeColor(NativeCallback textStrokeColorCallback)
Sets the text stroke color callback.
|
void |
setTextStrokeColor(String color)
Sets the text stroke color.
|
void |
setTextStrokeWidth(int textStrokeWidth)
Sets the text stroke width.
|
void |
setTextStrokeWidth(NativeCallback textStrokeWidthCallback)
Sets the text stroke width callback.
|
void |
setTextStrokeWidth(WidthCallback<DataLabelsContext> textStrokeWidthCallback)
Sets the text stroke width callback.
|
applyingDefaults, getEvents, getId, getPluginId, loadGlobalsPluginOptions, setEvents, setEvents, store, store, store, store
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
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
protected void applyingDefaults()
AbstractPluginOptions
applyingDefaults
in class AbstractPluginOptions
public final Padding getPadding()
public final Font getFont()
public final Listeners getListeners()
public final void setListenersHandler(AbstractEventHandler handler)
handler
- event handler instance as listener for all events.public final void setAlign(Align align)
align
- the position of the label relative to the anchor point position and orientation.public final void setAlign(double align)
align
- the position of the label relative to the anchor point position and orientation, by a number representing the clockwise angle (in degree)public final Align getAlign()
public final double getAlignDegrees()
public final void setAnchor(Anchor anchor)
anchor
- the anchor point, which is defined by an orientation vector and a position on the data element.public final Anchor getAnchor()
public final void setBackgroundColor(IsColor color)
color
- the background colorpublic final void setBackgroundColor(String color)
color
- the background colorpublic final String getBackgroundColorAsString()
public final IsColor getBackgroundColor()
public final void setBorderColor(IsColor color)
color
- the border colorpublic final void setBorderColor(String color)
color
- the border colorpublic final String getBorderColorAsString()
public final IsColor getBorderColor()
public final void setBorderRadius(double radius)
radius
- the border radius.public final double getBorderRadius()
public final void setBorderWidth(int width)
width
- the border width.public final int getBorderWidth()
public final void setClamp(boolean clamp)
true
to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).clamp
- true
to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).public final boolean isClamp()
true
to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).true
to enforce the anchor position to be calculated based on the visible geometry of the associated element (i.e. part inside the chart area).public final void setClip(boolean clip)
true
, the part of the label which is outside the chart area will be masked.clip
- when the clip option is true
, the part of the label which is outside the chart area will be masked.public final boolean isClip()
true
, the part of the label which is outside the chart area will be masked.true
, the part of the label which is outside the chart area will be masked.public final void setColor(IsColor color)
color
- the colorpublic final void setColor(String color)
color
- the colorpublic final String getColorAsString()
public final IsColor getColor()
public final void setDisplay(boolean display)
display
- the visibility of labels.public final void setDisplay(Display display)
display
- the visibility of labels.public final Display getDisplay()
public final void setOffset(int offset)
offset
- 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.public final int getOffset()
public final void setOpacity(double opacity)
opacity
- the opacity.public final double getOpacity()
public final void setRotation(double rotation)
rotation
- the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.public final double getRotation()
public final void setTextAlign(TextAlign textAlign)
textAlign
- the text alignment being used when drawing the label text when multiple linespublic final TextAlign getTextAlign()
public final void setTextStrokeColor(IsColor color)
color
- the text stroke colorpublic final void setTextStrokeColor(String color)
color
- the text stroke color.public final String getTextStrokeColorAsString()
public final IsColor getTextStrokeColor()
public final void setTextStrokeWidth(int textStrokeWidth)
textStrokeWidth
- the text stroke width.public final int getTextStrokeWidth()
public final void setTextShadowBlur(double textShadowBlur)
textShadowBlur
- the text shadow blur.public final double getTextShadowBlur()
public final void setTextShadowColor(IsColor color)
color
- the text shadow color colorpublic final void setTextShadowColor(String color)
color
- the text shadow color color.public final String getTextShadowColorAsString()
public final IsColor getTextShadowColor()
public final ColorCallback<DataLabelsContext> getBackgroundColorCallback()
null
.null
.public final void setBackgroundColor(ColorCallback<DataLabelsContext> backgroundColorCallback)
backgroundColorCallback
- the background color callback.public final void setBackgroundColor(NativeCallback backgroundColorCallback)
backgroundColorCallback
- the background color callback.public final ColorCallback<DataLabelsContext> getBorderColorCallback()
null
.null
.public final void setBorderColor(ColorCallback<DataLabelsContext> borderColorCallback)
borderColorCallback
- the border color callback.public final void setBorderColor(NativeCallback borderColorCallback)
borderColorCallback
- the border color callback.public final ColorCallback<DataLabelsContext> getColorCallback()
null
.null
.public final void setColor(ColorCallback<DataLabelsContext> colorCallback)
colorCallback
- the color callback.public final void setColor(NativeCallback colorCallback)
colorCallback
- the color callback.public final FormatterCallback getFormatterCallback()
null
.null
.public final void setFormatter(FormatterCallback formatterCallback)
formatterCallback
- the formatter callback to setpublic final AlignCallback getAlignCallback()
null
.null
.public final void setAlign(AlignCallback alignCallback)
alignCallback
- the align callback to setpublic final void setAlign(NativeCallback alignCallback)
alignCallback
- the align callback to setpublic final AnchorCallback getAnchorCallback()
null
.null
.public final void setAnchor(AnchorCallback anchorCallback)
anchorCallback
- the anchor callback to setpublic final void setAnchor(NativeCallback anchorCallback)
anchorCallback
- the anchor callback to setpublic final RadiusCallback<DataLabelsContext> getBorderRadiusCallback()
null
.null
.public final void setBorderRadius(RadiusCallback<DataLabelsContext> borderRadiusCallback)
borderRadiusCallback
- the border radius callback to setpublic final void setBorderRadius(NativeCallback borderRadiusCallback)
borderRadiusCallback
- the border radius callback to setpublic final WidthCallback<DataLabelsContext> getBorderWidthCallback()
null
.null
.public final void setBorderWidth(WidthCallback<DataLabelsContext> borderWidthCallback)
borderWidthCallback
- the border width callback to setpublic final void setBorderWidth(NativeCallback borderWidthCallback)
borderWidthCallback
- the border width callback to setpublic final ClampCallback getClampCallback()
null
.null
.public final void setClamp(ClampCallback clampCallback)
clampCallback
- the clamp callback to setpublic final void setClamp(NativeCallback clampCallback)
clampCallback
- the clamp callback to setpublic final ClipCallback getClipCallback()
null
.null
.public final void setClip(ClipCallback clipCallback)
clipCallback
- the clip callback to setpublic final void setClip(NativeCallback clipCallback)
clipCallback
- the clip callback to setpublic final DisplayCallback getDisplayCallback()
null
.null
.public final void setDisplay(DisplayCallback displayCallback)
displayCallback
- the display callback to setpublic final void setDisplay(NativeCallback displayCallback)
displayCallback
- the display callback to setpublic final OffsetCallback<DataLabelsContext> getOffsetCallback()
null
.null
.public final void setOffset(OffsetCallback<DataLabelsContext> offsetCallback)
offsetCallback
- the offset callback to setpublic final void setOffset(NativeCallback offsetCallback)
offsetCallback
- the offset callback to setpublic final OpacityCallback getOpacityCallback()
null
.null
.public final void setOpacity(OpacityCallback opacityCallback)
opacityCallback
- the opacity callback to setpublic final void setOpacity(NativeCallback opacityCallback)
opacityCallback
- the opacity callback to setpublic final RotationCallback<DataLabelsContext> getRotationCallback()
null
.null
.public final void setRotation(RotationCallback<DataLabelsContext> rotationCallback)
rotationCallback
- the rotation callback to setpublic final void setRotation(NativeCallback rotationCallback)
rotationCallback
- the rotation callback to setpublic final TextAlignCallback<DataLabelsContext> getTextAlignCallback()
null
.null
.public final void setTextAlign(TextAlignCallback<DataLabelsContext> textAlignCallback)
textAlignCallback
- the text align callback to setpublic final void setTextAlign(NativeCallback textAlignCallback)
textAlignCallback
- the text align callback to setpublic final ColorCallback<DataLabelsContext> getTextStrokeColorCallback()
null
.null
.public final void setTextStrokeColor(ColorCallback<DataLabelsContext> textStrokeColorCallback)
textStrokeColorCallback
- the text stroke color callback to setpublic final void setTextStrokeColor(NativeCallback textStrokeColorCallback)
textStrokeColorCallback
- the text stroke color callback to setpublic final WidthCallback<DataLabelsContext> getTextStrokeWidthCallback()
null
.null
.public final void setTextStrokeWidth(WidthCallback<DataLabelsContext> textStrokeWidthCallback)
textStrokeWidthCallback
- the text stroke width callback to setpublic final void setTextStrokeWidth(NativeCallback textStrokeWidthCallback)
textStrokeWidthCallback
- the text stroke width callback to setpublic final TextShadowBlurCallback getTextShadowBlurCallback()
null
.null
.public final void setTextShadowBlur(TextShadowBlurCallback textShadowBlurCallback)
textShadowBlurCallback
- the text shadow blur callback to setpublic final void setTextShadowBlur(NativeCallback textShadowBlurCallback)
textShadowBlurCallback
- the text shadow blur callback to setpublic final ColorCallback<DataLabelsContext> getTextShadowColorCallback()
null
.null
.public final void setTextShadowColor(ColorCallback<DataLabelsContext> textShadowColorCallback)
textShadowColorCallback
- the text shadow color callback to setpublic final void setTextShadowColor(NativeCallback textShadowColorCallback)
textShadowColorCallback
- the text shadow color callback to setpublic final FontCallback<DataLabelsContext> getFontCallback()
null
.getFontCallback
in interface IsScriptableFontProvider<DataLabelsContext>
null
.public final void setFont(FontCallback<DataLabelsContext> fontCallback)
setFont
in interface IsScriptableFontProvider<DataLabelsContext>
fontCallback
- the font callback to setpublic final void setFont(NativeCallback fontCallback)
setFont
in interface IsScriptableFontProvider<DataLabelsContext>
fontCallback
- the font callback to setpublic final PaddingCallback<DataLabelsContext> getPaddingCallback()
null
.getPaddingCallback
in interface IsScriptablePaddingProvider<DataLabelsContext>
null
.public final void setPadding(PaddingCallback<DataLabelsContext> paddingCallback)
setPadding
in interface IsScriptablePaddingProvider<DataLabelsContext>
paddingCallback
- the padding callback to setpublic final void setPadding(NativeCallback paddingCallback)
setPadding
in interface IsScriptablePaddingProvider<DataLabelsContext>
paddingCallback
- the padding callback to set