Class DataLabelsOptions

    • Field Detail

      • DEFAULT_ALIGN

        public static final Align DEFAULT_ALIGN
        Default position of the label relative to the anchor point position and orientation, Align.CENTER.
      • DEFAULT_ANCHOR

        public 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_COLOR

        public static final String DEFAULT_BACKGROUND_COLOR
        Default background color, null, and uses the background color of dataset.
      • DEFAULT_BORDER_COLOR

        public static final String DEFAULT_BORDER_COLOR
        Default border color, null, and uses the border color of dataset.
      • DEFAULT_BORDER_RADIUS

        public static final double DEFAULT_BORDER_RADIUS
        Default border radius of labels, 0.0.
        See Also:
        Constant Field Values
      • DEFAULT_BORDER_WIDTH

        public static final int DEFAULT_BORDER_WIDTH
        Default border width of labels, 0.
        See Also:
        Constant Field Values
      • DEFAULT_CLAMP

        public 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_CLIP

        public 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_DISPLAY

        public static final Display DEFAULT_DISPLAY
        Default visibility of labels, Display.TRUE.
      • DEFAULT_OFFSET

        public 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_OPACITY

        public static final double DEFAULT_OPACITY
        Default opacity, 1.0.
        See Also:
        Constant Field Values
      • DEFAULT_ROTATION

        public static final double DEFAULT_ROTATION
        Default clockwise rotation angle (in degrees) of the label, 0.0.
        See Also:
        Constant Field Values
      • DEFAULT_TEXT_ALIGN

        public static final TextAlign DEFAULT_TEXT_ALIGN
        Default text alignment being used when drawing the label text, TextAlign.START.
      • DEFAULT_TEXT_STROKE_WIDTH

        public static final int DEFAULT_TEXT_STROKE_WIDTH
        Default text stroke width, 0.
        See Also:
        Constant Field Values
      • DEFAULT_TEXT_SHADOW_BLUR

        public static final double DEFAULT_TEXT_SHADOW_BLUR
        Default text shadow blur, 0.0.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DataLabelsOptions

        public DataLabelsOptions()
        Creates new DataLabelsPlugin.ID plugin options.
      • DataLabelsOptions

        public DataLabelsOptions​(IsChart chart)
        Creates new DataLabelsPlugin.ID plugin options, relating to chart instance for default.
        Parameters:
        chart - chart instance related to the plugin options
    • Method Detail

      • getLabels

        public Labels getLabels()
        Returns the labels element.
        Returns:
        the labels element.
      • getFont

        public abstract IsDefaultFont getFont()
        Returns the font element.
        Returns:
        the font element.
      • getPadding

        public abstract IsDefaultPadding getPadding()
        Returns the padding element.
        Returns:
        the padding element.
      • getListeners

        public abstract org.pepstock.charba.client.datalabels.IsDefaultListeners getListeners()
        Returns the listeners element.
        Returns:
        the listeners element.
      • getAlign

        public 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.
      • getAnchor

        public 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.
      • getBackgroundColorAsString

        public default String getBackgroundColorAsString()
        Returns the background color as string.
        Returns:
        the background color as string. If null, it uses the background color of dataset.
      • getBorderColorAsString

        public default String getBorderColorAsString()
        Returns the border color as string.
        Returns:
        the border color as string. If null, it uses the border color of dataset.
      • getBorderRadius

        public default double getBorderRadius()
        Returns the border radius.
        Returns:
        the border radius.
      • getBorderWidth

        public default int getBorderWidth()
        Returns the border width.
        Returns:
        the border width.
      • isClamp

        public default boolean isClamp()
        Returns 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).
        Returns:
        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).
      • isClip

        public default boolean isClip()
        When the clip option is true, 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.
      • getColorAsString

        public default String getColorAsString()
        Returns the color as string.
        Returns:
        the color as string.
      • getDisplay

        public default Display getDisplay()
        Returns the visibility of labels.
        Returns:
        the visibility of labels.
      • getOffset

        public 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.
      • getOpacity

        public default double getOpacity()
        Returns the opacity.
        Returns:
        the opacity.
      • getRotation

        public 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.
      • getTextAlign

        public 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.
      • getTextStrokeColorAsString

        public default String getTextStrokeColorAsString()
        Returns the text stroke color as string.
        Returns:
        the text stroke color as string.
      • getTextStrokeWidth

        public default int getTextStrokeWidth()
        Returns the text stroke width.
        Returns:
        the text stroke width.
      • getTextShadowBlur

        public default double getTextShadowBlur()
        Returns the text shadow blur.
        Returns:
        the text shadow blur.
      • getTextShadowColorAsString

        public default String getTextShadowColorAsString()
        Returns the text shadow color as string.
        Returns:
        the text shadow color as string.
      • getBackgroundColorCallback

        public default ColorCallback<DataLabelsContext> getBackgroundColorCallback()
        Returns the background color callback.
        Returns:
        the background color callback.
      • getBorderColorCallback

        public default ColorCallback<DataLabelsContext> getBorderColorCallback()
        Returns the border color callback.
        Returns:
        the border color callback.
      • getFormatterCallback

        public default FormatterCallback getFormatterCallback()
        Returns the formatter callback.
        Returns:
        the formatter callback.
      • getAlignCallback

        public default AlignCallback getAlignCallback()
        Returns the align callback.
        Returns:
        the align callback.
      • getAnchorCallback

        public default AnchorCallback getAnchorCallback()
        Returns the anchor callback.
        Returns:
        the anchor callback.
      • getBorderRadiusCallback

        public default RadiusCallback<DataLabelsContext> getBorderRadiusCallback()
        Returns the border radius callback.
        Returns:
        the border radius callback.
      • getBorderWidthCallback

        public default WidthCallback<DataLabelsContext> getBorderWidthCallback()
        Returns the border width callback.
        Returns:
        the border width callback.
      • getClampCallback

        public default ClampCallback getClampCallback()
        Returns the clamp callback.
        Returns:
        the clamp callback.
      • getClipCallback

        public default ClipCallback getClipCallback()
        Returns the clip callback.
        Returns:
        the clip callback.
      • getDisplayCallback

        public default DisplayCallback getDisplayCallback()
        Returns the display callback.
        Returns:
        the display callback.
      • getOpacityCallback

        public default OpacityCallback getOpacityCallback()
        Returns the opacity callback.
        Returns:
        the opacity callback.
      • getTextStrokeColorCallback

        public default ColorCallback<DataLabelsContext> getTextStrokeColorCallback()
        Returns the text stroke color callback.
        Returns:
        the text stroke color callback.
      • getTextStrokeWidthCallback

        public default WidthCallback<DataLabelsContext> getTextStrokeWidthCallback()
        Returns the text stroke width callback.
        Returns:
        the text stroke width callback.
      • getTextShadowBlurCallback

        public default TextShadowBlurCallback getTextShadowBlurCallback()
        Returns the text shadow blur callback.
        Returns:
        the text shadow blur callback.
      • getTextShadowColorCallback

        public default ColorCallback<DataLabelsContext> getTextShadowColorCallback()
        Returns the text shadow color callback.
        Returns:
        the text shadow color callback.