Class CrosshairLabel


  • public final class CrosshairLabel
    extends NativeObjectContainer
    Crosshair.ID plugin configuration element in order to have in the chart the label on the axes where the mouse is positioned.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_COLOR_AS_STRING

        public static final String DEFAULT_COLOR_AS_STRING
        Default font color for label, as string, HtmlColor.WHITE.
      • DEFAULT_BACKGROUND_COLOR

        public static final IsColor DEFAULT_BACKGROUND_COLOR
        Default background color for label, rgb(110, 112, 121).
      • DEFAULT_BACKGROUND_COLOR_AS_STRING

        public static final String DEFAULT_BACKGROUND_COLOR_AS_STRING
        Default background color for label, as string, rgb(110, 112, 121).
      • DEFAULT_BORDER_COLOR_AS_STRING

        public static final String DEFAULT_BORDER_COLOR_AS_STRING
        Default border color for label, as string, HtmlColor.TRANSPARENT.
      • DEFAULT_BORDER_WIDTH

        public static final int DEFAULT_BORDER_WIDTH
        Default border width for crosshair label, value is 0.
        See Also:
        Constant Field Values
      • DEFAULT_DISPLAY

        public static final boolean DEFAULT_DISPLAY
        Default flag if crosshair label must be showed in the chart, value is true.
        See Also:
        Constant Field Values
      • DEFAULT_PADDING

        public static final int DEFAULT_PADDING
        Default padding for crosshair label, value is 6.
        See Also:
        Constant Field Values
      • DEFAULT_BORDER_RADIUS

        public static final int DEFAULT_BORDER_RADIUS
        Default border radius for crosshair label, value is 6.
        See Also:
        Constant Field Values
    • Method Detail

      • getFont

        public IsFont getFont()
        Returns the font object.
        Returns:
        the font object.
      • setDisplay

        public void setDisplay​(boolean display)
        Sets true if label will be applied in the chart, otherwise false.
        Parameters:
        display - true if label will be applied in the chart, otherwise false
      • isDisplay

        public boolean isDisplay()
        Returns true if label will be applied in the chart, otherwise false.
        Returns:
        true if label will be applied in the chart, otherwise false
      • getColorAsString

        public String getColorAsString()
        Returns the crosshair label font color.
        Returns:
        the crosshair label font color.
      • getColor

        public IsColor getColor()
        Returns the crosshair label font color.
        Returns:
        the crosshair label font color.
      • setColor

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

        public void setColor​(IsColor color)
        Set the crosshair label font color.
        Parameters:
        color - the crosshair label font color.
      • setPadding

        public void setPadding​(int padding)
        Sets the padding of crosshair label.
        Parameters:
        padding - padding of crosshair label
      • getPadding

        public int getPadding()
        Returns the padding of crosshair label.
        Returns:
        the padding of crosshair label
      • setBackgroundColor

        public void setBackgroundColor​(String color)
        Sets the background color.
        Parameters:
        color - the background color.
      • setBackgroundColor

        public void setBackgroundColor​(IsColor color)
        Sets the background color.
        Parameters:
        color - the background color.
      • getBackgroundColorAsString

        public String getBackgroundColorAsString()
        Returns the background color.
        Returns:
        the background color.
      • getBackgroundColor

        public IsColor getBackgroundColor()
        Returns the background color.
        Returns:
        the background color.
      • setBorderRadius

        public void setBorderRadius​(int borderRadius)
        Sets the label border radius (in pixels).
        Parameters:
        borderRadius - the label border radius (in pixels).
      • getBorderRadius

        public int getBorderRadius()
        Returns the label border radius (in pixels).
        Returns:
        the label border radius (in pixels).
      • setBorderColor

        public void setBorderColor​(IsColor borderColor)
        Sets the border color.
        Parameters:
        borderColor - the border color.
      • setBorderColor

        public void setBorderColor​(String borderColor)
        Sets the border color.
        Parameters:
        borderColor - the border color.
      • getBorderColorAsString

        public String getBorderColorAsString()
        Returns the border color.
        Returns:
        the border color.
      • getBorderColor

        public IsColor getBorderColor()
        Returns the border color.
        Returns:
        the border color.
      • setBorderWidth

        public void setBorderWidth​(int borderWidth)
        Sets the border width.
        Parameters:
        borderWidth - the border width.
      • getBorderWidth

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

        public CrosshairFormatterCallback getFormatter()
        Returns the callback which can be implemented to change the text of label.
        Returns:
        the callback which can be implemented to change the text of label
      • setFormatter

        public void setFormatter​(CrosshairFormatterCallback formatterCallback)
        Sets the callback which can be implemented to change the text of label.
        Parameters:
        formatterCallback - the callback which can be implemented to change the text of label