Class AbstractBuilder<T extends LabelItem>

    • Method Detail

      • setListenersHandler

        public final AbstractBuilder<T> setListenersHandler​(AbstractEventHandler handler)
        Adds a event handler instance as listener for all events.
        Parameters:
        handler - event handler instance as listener for all events.
        Returns:
        builder instance
      • setAlign

        public final AbstractBuilder<T> setAlign​(Align align)
        Sets the position of the label relative to the anchor point position and orientation.
        Parameters:
        align - the position of the label relative to the anchor point position and orientation.
        Returns:
        builder instance
      • setAlign

        public final AbstractBuilder<T> 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).
        Parameters:
        align - the position of the label relative to the anchor point position and orientation, by a number representing the clockwise angle (in degree)
        Returns:
        builder instance
      • setAnchor

        public final AbstractBuilder<T> setAnchor​(Anchor anchor)
        Sets the anchor point, which is defined by an orientation vector and a position on the data element.
        Parameters:
        anchor - the anchor point, which is defined by an orientation vector and a position on the data element.
        Returns:
        builder instance
      • setBackgroundColor

        public final AbstractBuilder<T> setBackgroundColor​(IsColor color)
        Sets the background color.
        Parameters:
        color - the background color
        Returns:
        builder instance
      • setBackgroundColor

        public final AbstractBuilder<T> setBackgroundColor​(String color)
        Sets the background color.
        Parameters:
        color - the background color
        Returns:
        builder instance
      • setBorderColor

        public final AbstractBuilder<T> setBorderColor​(IsColor color)
        Sets the border color.
        Parameters:
        color - the border color
        Returns:
        builder instance
      • setBorderColor

        public final AbstractBuilder<T> setBorderColor​(String color)
        Sets the border color.
        Parameters:
        color - the border color
        Returns:
        builder instance
      • setBorderRadius

        public final AbstractBuilder<T> setBorderRadius​(double radius)
        Sets the border radius.
        Parameters:
        radius - the border radius.
        Returns:
        builder instance
      • setBorderWidth

        public final AbstractBuilder<T> setBorderWidth​(int width)
        Sets the border width.
        Parameters:
        width - the border width.
        Returns:
        builder instance
      • setClamp

        public final AbstractBuilder<T> setClamp​(boolean clamp)
        Sets 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).
        Parameters:
        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).
        Returns:
        builder instance
      • setClip

        public final AbstractBuilder<T> setClip​(boolean clip)
        When the clip option is true, the part of the label which is outside the chart area will be masked.
        Parameters:
        clip - when the clip option is true, the part of the label which is outside the chart area will be masked.
        Returns:
        builder instance
      • setColor

        public final AbstractBuilder<T> setColor​(IsColor color)
        Sets the color.
        Parameters:
        color - the color
        Returns:
        builder instance
      • setColor

        public final AbstractBuilder<T> setColor​(String color)
        Sets the color.
        Parameters:
        color - the color
        Returns:
        builder instance
      • setDisplay

        public final AbstractBuilder<T> setDisplay​(boolean display)
        Sets the visibility of labels.
        Parameters:
        display - the visibility of labels.
        Returns:
        builder instance
      • setDisplay

        public final AbstractBuilder<T> setDisplay​(Display display)
        Sets the visibility of labels.
        Parameters:
        display - the visibility of labels.
        Returns:
        builder instance
      • setOffset

        public final AbstractBuilder<T> setOffset​(int offset)
        Sets 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.
        Parameters:
        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.
        Returns:
        builder instance
      • setOpacity

        public final AbstractBuilder<T> setOpacity​(double opacity)
        Sets the opacity.
        Parameters:
        opacity - the opacity.
        Returns:
        builder instance
      • setRotation

        public final AbstractBuilder<T> setRotation​(double rotation)
        Sets the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.
        Parameters:
        rotation - the clockwise rotation angle (in degrees) of the label, the rotation center point being the label center.
        Returns:
        builder instance
      • setTextAlign

        public final AbstractBuilder<T> setTextAlign​(TextAlign textAlign)
        Sets the text alignment being used when drawing the label text.
        Parameters:
        textAlign - the text alignment being used when drawing the label text.
        Returns:
        builder instance
      • setTextStrokeColor

        public final AbstractBuilder<T> setTextStrokeColor​(IsColor color)
        Sets the text stroke color.
        Parameters:
        color - the text stroke color
        Returns:
        builder instance
      • setTextStrokeColor

        public final AbstractBuilder<T> setTextStrokeColor​(String color)
        Sets the text stroke color.
        Parameters:
        color - the text stroke color.
        Returns:
        builder instance
      • setTextStrokeWidth

        public final AbstractBuilder<T> setTextStrokeWidth​(int textStrokeWidth)
        Sets the text stroke width.
        Parameters:
        textStrokeWidth - the text stroke width.
        Returns:
        builder instance
      • setTextShadowBlur

        public final AbstractBuilder<T> setTextShadowBlur​(double textShadowBlur)
        Sets the text shadow blur.
        Parameters:
        textShadowBlur - the text shadow blur.
        Returns:
        builder instance
      • setTextShadowColor

        public final AbstractBuilder<T> setTextShadowColor​(IsColor color)
        Sets the text shadow color color.
        Parameters:
        color - the text shadow color color
        Returns:
        builder instance
      • setTextShadowColor

        public final AbstractBuilder<T> setTextShadowColor​(String color)
        Sets the text shadow color color.
        Parameters:
        color - the text shadow color color.
        Returns:
        builder instance
      • setBackgroundColor

        public final AbstractBuilder<T> setBackgroundColor​(ColorCallback<DataLabelsContext> backgroundColorCallback)
        Sets the background color callback.
        Parameters:
        backgroundColorCallback - the background color callback.
        Returns:
        builder instance
      • setBorderColor

        public final AbstractBuilder<T> setBorderColor​(ColorCallback<DataLabelsContext> borderColorCallback)
        Sets the border color callback.
        Parameters:
        borderColorCallback - the border color callback.
        Returns:
        builder instance
      • setFormatter

        public final AbstractBuilder<T> setFormatter​(FormatterCallback formatterCallback)
        Sets the formatter callback.
        Parameters:
        formatterCallback - the formatter callback to set
        Returns:
        builder instance
      • setAlign

        public final AbstractBuilder<T> setAlign​(AlignCallback alignCallback)
        Sets the align callback.
        Parameters:
        alignCallback - the align callback to set
        Returns:
        builder instance
      • setAnchor

        public final AbstractBuilder<T> setAnchor​(AnchorCallback anchorCallback)
        Sets the anchor callback.
        Parameters:
        anchorCallback - the anchor callback to set
        Returns:
        builder instance
      • setBorderRadius

        public final AbstractBuilder<T> setBorderRadius​(RadiusCallback<DataLabelsContext> borderRadiusCallback)
        Sets the border radius callback.
        Parameters:
        borderRadiusCallback - the border radius callback to set
        Returns:
        builder instance
      • setBorderWidth

        public final AbstractBuilder<T> setBorderWidth​(WidthCallback<DataLabelsContext> borderWidthCallback)
        Sets the border width callback.
        Parameters:
        borderWidthCallback - the border width callback to set
        Returns:
        builder instance
      • setClamp

        public final AbstractBuilder<T> setClamp​(ClampCallback clampCallback)
        Sets the clamp callback.
        Parameters:
        clampCallback - the clamp callback to set
        Returns:
        builder instance
      • setClip

        public final AbstractBuilder<T> setClip​(ClipCallback clipCallback)
        Sets the clip callback.
        Parameters:
        clipCallback - the clip callback to set
        Returns:
        builder instance
      • setDisplay

        public final AbstractBuilder<T> setDisplay​(DisplayCallback displayCallback)
        Sets the display callback.
        Parameters:
        displayCallback - the display callback to set
        Returns:
        builder instance
      • setOpacity

        public final AbstractBuilder<T> setOpacity​(OpacityCallback opacityCallback)
        Sets the opacity callback.
        Parameters:
        opacityCallback - the opacity callback to set
        Returns:
        builder instance
      • setTextStrokeColor

        public final AbstractBuilder<T> setTextStrokeColor​(ColorCallback<DataLabelsContext> textStrokeColorCallback)
        Sets the text stroke color callback.
        Parameters:
        textStrokeColorCallback - the text stroke color callback to set
        Returns:
        builder instance
      • setTextStrokeWidth

        public final AbstractBuilder<T> setTextStrokeWidth​(WidthCallback<DataLabelsContext> textStrokeWidthCallback)
        Sets the text stroke width callback.
        Parameters:
        textStrokeWidthCallback - the text stroke width callback to set
        Returns:
        builder instance
      • setTextShadowBlur

        public final AbstractBuilder<T> setTextShadowBlur​(TextShadowBlurCallback textShadowBlurCallback)
        Sets the text shadow blur callback.
        Parameters:
        textShadowBlurCallback - the text shadow blur callback to set
        Returns:
        builder instance
      • setTextShadowColor

        public final AbstractBuilder<T> setTextShadowColor​(ColorCallback<DataLabelsContext> textShadowColorCallback)
        Sets the text shadow color callback.
        Parameters:
        textShadowColorCallback - the text shadow color callback to set
        Returns:
        builder instance
      • setFontSize

        public final AbstractBuilder<T> setFontSize​(int fontSize)
        Sets the font size.
        Parameters:
        fontSize - the font size.
        Returns:
        builder instance
      • setFontStyle

        public final AbstractBuilder<T> setFontStyle​(FontStyle fontStyle)
        Sets the font style, follows CSS font-style label (i.e. normal, italic, oblique, initial, inherit).
        Parameters:
        fontStyle - Font style, follows CSS font-style label (i.e. normal, italic, oblique, initial, inherit).
        Returns:
        builder instance
      • setFontFamily

        public final AbstractBuilder<T> setFontFamily​(String fontFamily)
        Sets the font family, follows CSS font-family label.
        Parameters:
        fontFamily - Font family, follows CSS font-family label.
        Returns:
        builder instance
      • setFontWeight

        public final AbstractBuilder<T> setFontWeight​(Weight weight)
        Sets the font weight, follows CSS font-style-weight label.
        Parameters:
        weight - font weight, follows CSS font-style-weight label.
        Returns:
        builder instance
      • setFontLineHeight

        public final AbstractBuilder<T> setFontLineHeight​(double lineHeight)
        Sets the line height.
        Parameters:
        lineHeight - the line height.
        Returns:
        builder instance
      • setFontLineHeight

        public final AbstractBuilder<T> setFontLineHeight​(String lineHeight)
        Sets the line height.
        Parameters:
        lineHeight - the line height.
        Returns:
        builder instance
      • setPadding

        public final AbstractBuilder<T> setPadding​(int padding)
        Sets the padding size to all dimensions.
        Parameters:
        padding - padding size to apply to all dimensions.
        Returns:
        builder instance
      • setPaddingLeft

        public final AbstractBuilder<T> setPaddingLeft​(int padding)
        Sets the padding left in pixel.
        Parameters:
        padding - the padding left in pixel.
        Returns:
        builder instance
      • setPaddingRight

        public final AbstractBuilder<T> setPaddingRight​(int padding)
        Sets the padding right in pixel.
        Parameters:
        padding - the padding right in pixel.
        Returns:
        builder instance
      • setPaddingTop

        public final AbstractBuilder<T> setPaddingTop​(int padding)
        Sets the padding top in pixel.
        Parameters:
        padding - the padding top in pixel.
        Returns:
        builder instance
      • setPaddingBottom

        public final AbstractBuilder<T> setPaddingBottom​(int padding)
        Sets the padding bottom in pixel.
        Parameters:
        padding - the padding bottom in pixel.
        Returns:
        builder instance
      • setClickEventHandler

        public final AbstractBuilder<T> setClickEventHandler​(ClickEventHandler clickEventHandler)
        Sets the CLICK event (the mouse's primary button is pressed and released on a label) handler.
        Parameters:
        clickEventHandler - the click event handler to set
        Returns:
        builder instance
      • setEnterEventHandler

        public final AbstractBuilder<T> setEnterEventHandler​(EnterEventHandler enterEventHandler)
        Sets the ENTER event (the mouse is moved over a label) handler.
        Parameters:
        enterEventHandler - the enter event handler to set
        Returns:
        builder instance
      • setLeaveEventHandler

        public final AbstractBuilder<T> setLeaveEventHandler​(LeaveEventHandler leaveEventHandler)
        Sets the LEAVE event (the mouse is moved out of a label) handler.
        Parameters:
        leaveEventHandler - the leave event handler to set
        Returns:
        builder instance