Class Label

    • Field Detail

      • DEFAULT_RENDER

        public static final Render DEFAULT_RENDER
        Default rendering (what data must be showed), Render.VALUE.
      • DEFAULT_PRECISION

        public static final int DEFAULT_PRECISION
        Default the precision for percentage, 0.
        See Also:
        Constant Field Values
      • DEFAULT_SHOW_ZERO

        public static final boolean DEFAULT_SHOW_ZERO
        Default to enable whether or not labels of value 0 are displayed, false.
        See Also:
        Constant Field Values
      • DEFAULT_TEXT_SHADOW

        public static final boolean DEFAULT_TEXT_SHADOW
        Default to enable if draws text shadows under labels, false.
        See Also:
        Constant Field Values
      • DEFAULT_SHADOW_BLUR

        public static final int DEFAULT_SHADOW_BLUR
        Default text shadow intensity, 6.
        See Also:
        Constant Field Values
      • DEFAULT_SHADOW_OFFSET_X

        public static final int DEFAULT_SHADOW_OFFSET_X
        Default text shadow X offset, 3.
        See Also:
        Constant Field Values
      • DEFAULT_SHADOW_OFFSET_Y

        public static final int DEFAULT_SHADOW_OFFSET_Y
        Default text shadow Y offset, 3.
        See Also:
        Constant Field Values
      • DEFAULT_SHADOW_COLOR

        public static final String DEFAULT_SHADOW_COLOR
        Default text shadow color, "rgba(0,0,0,0.3)".
        See Also:
        Constant Field Values
      • DEFAULT_ARC

        public static final boolean DEFAULT_ARC
        Default to enable drawing label in arc, false.
        See Also:
        Constant Field Values
      • DEFAULT_OVERLAP

        public static final boolean DEFAULT_OVERLAP
        Default to enable drawing label even it's overlap, true.
        See Also:
        Constant Field Values
      • DEFAULT_SHOW_ACTUAL_PERCENTAGES

        public static final boolean DEFAULT_SHOW_ACTUAL_PERCENTAGES
        Default to enable showing the real calculated percentages from the values, false.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Label

        public Label()
        Creates new LabelsPlugin.ID plugin label, using an incremental id.
      • Label

        public Label​(String id)
        Creates new LabelsPlugin.ID plugin label, using the id passed as argument as label id.
        Parameters:
        id - id to apply to new label.
      • Label

        public Label​(LabelId id)
        Creates new LabelsPlugin.ID plugin label, using the id passed as argument as label id.
        Parameters:
        id - id to apply to new label.
    • Method Detail

      • getId

        public LabelId getId()
        Returns the id of label.
        Returns:
        the id of label
      • getFont

        public Font getFont()
        Returns the font object.
        Returns:
        the font object.
      • setColor

        public void setColor​(IsColor color)
        Sets the font color.
        Parameters:
        color - font color.
      • setColor

        public void setColor​(String color)
        Sets the font color.
        Parameters:
        color - font color.
      • getColorAsString

        public String getColorAsString()
        Returns the font color as string.
        Returns:
        font color as string
      • getColor

        public IsColor getColor()
        Returns the font color.
        Returns:
        font color
      • setRender

        public void setRender​(Render render)
        Sets what data must be showed.
        Parameters:
        render - what data must be showed.
      • getRender

        public Render getRender()
        Returns what data must be showed.
        Returns:
        what data must be showed.
      • setPrecision

        public void setPrecision​(int precision)
        Sets the precision for percentage.
        Parameters:
        precision - the precision for percentage
      • getPrecision

        public int getPrecision()
        Returns the precision for percentage.
        Returns:
        the precision for percentage.
      • setShowZero

        public void setShowZero​(boolean showZero)
        Sets whether or not labels of value 0 are displayed.
        Parameters:
        showZero - whether or not labels of value 0 are displayed.
      • isShowZero

        public boolean isShowZero()
        Returns whether or not labels of value 0 are displayed.
        Returns:
        whether or not labels of value 0 are displayed.
      • setTextShadow

        public void setTextShadow​(boolean textShadow)
        Sets if draws text shadows under labels.
        Parameters:
        textShadow - true if draws text shadows under labels.
      • isTextShadow

        public boolean isTextShadow()
        Returns if draws text shadows under labels.
        Returns:
        true if draws text shadows under labels.
      • setShadowBlur

        public void setShadowBlur​(int shadowBlur)
        Sets the text shadow intensity.
        Parameters:
        shadowBlur - the text shadow intensity.
      • getShadowBlur

        public int getShadowBlur()
        Returns the text shadow intensity.
        Returns:
        the text shadow intensity.
      • setShadowOffsetX

        public void setShadowOffsetX​(int shadowOffsetX)
        Sets the text shadow X offset.
        Parameters:
        shadowOffsetX - the text shadow X offset.
      • getShadowOffsetX

        public int getShadowOffsetX()
        Returns the text shadow X offset.
        Returns:
        the text shadow X offset.
      • setShadowOffsetY

        public void setShadowOffsetY​(int shadowOffsetY)
        Sets the text shadow Y offset.
        Parameters:
        shadowOffsetY - the text shadow Y offset.
      • getShadowOffsetY

        public int getShadowOffsetY()
        Returns the text shadow Y offset.
        Returns:
        the text shadow Y offset.
      • setShadowColor

        public void setShadowColor​(IsColor shadowColor)
        Sets the text shadow color as color.
        Parameters:
        shadowColor - the text shadow color as color.
      • setShadowColor

        public void setShadowColor​(String shadowColor)
        Sets the text shadow color as string.
        Parameters:
        shadowColor - the text shadow color as string.
      • getShadowColorAsString

        public String getShadowColorAsString()
        Returns the text shadow color as string.
        Returns:
        the text shadow color as string.
      • getShadowColor

        public IsColor getShadowColor()
        Returns the text shadow color as color.
        Returns:
        the text shadow color as color.
      • setArc

        public void setArc​(boolean arc)
        Sets if draws label in arc. For bar chart this is ignored.
        Parameters:
        arc - if draws label in arc.
      • isArc

        public boolean isArc()
        Returns if draws label in arc.
        Returns:
        true if draws label in arc.
      • setPosition

        public void setPosition​(Position position)
        + Sets the position to draw label. For bar chart this is ignored.
        Parameters:
        position - the position to draw label.
      • getPosition

        public Position getPosition()
        Returns the position to draw label.
        Returns:
        the position to draw label.
      • setOverlap

        public void setOverlap​(boolean overlap)
        Sets if draws label even it's overlap. For bar chart this is ignored.
        Parameters:
        overlap - if draws label even it's overlap.
      • isOverlap

        public boolean isOverlap()
        Returns if draws label even it's overlap.
        Returns:
        trueif draws label even it's overlap.
      • setShowActualPercentages

        public void setShowActualPercentages​(boolean showActualPercentages)
        Sets if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.
        Parameters:
        showActualPercentages - if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.
      • isShowActualPercentages

        public boolean isShowActualPercentages()
        Returns if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.
        Returns:
        trueif shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.
      • setOutsidePadding

        public void setOutsidePadding​(int outsidePadding)
        Sets the padding when position is Position.OUTSIDE.
        Parameters:
        outsidePadding - the padding when position is Position.OUTSIDE.
      • getOutsidePadding

        public int getOutsidePadding()
        Returns the padding when position is Position.OUTSIDE.
        Returns:
        the padding when position is Position.OUTSIDE.
      • getRenderCallback

        public RenderCallback getRenderCallback()
        Returns the render callback, if set, otherwise null.
        Returns:
        the render callback, if set, otherwise null
      • setRender

        public void setRender​(RenderCallback renderCallback)
        Sets the render callback.
        Parameters:
        renderCallback - the render callback to set
      • setRender

        public void setRender​(NativeCallback renderCallback)
        Sets the render callback.
        Parameters:
        renderCallback - the render callback to set
      • getColorCallback

        public ColorCallback<LabelsContext> getColorCallback()
        Returns the font color callback, if set, otherwise null.
        Returns:
        the font color callback, if set, otherwise null
      • setColor

        public void setColor​(ColorCallback<LabelsContext> colorCallback)
        Sets the font color callback.
        Parameters:
        colorCallback - the font color callback.
      • setColor

        public void setColor​(NativeCallback colorCallback)
        Sets the font color callback.
        Parameters:
        colorCallback - the font color callback.