Class CommonElementOptions

    • Constructor Detail

      • CommonElementOptions

        protected CommonElementOptions​(NativeObject nativeObject)
        Creates the item using a native java script object which contains all properties.
        Parameters:
        nativeObject - native java script object which contains all properties.
    • Method Detail

      • getDefaultBorderWidth

        protected int getDefaultBorderWidth()
        This method must be overrided by all element where the border width is stored in different object.
        Returns:
        an undefined integer
      • isBackgroundColorAsColor

        public final boolean isBackgroundColorAsColor()
        Returns true if the background color is defined as color.
        Returns:
        true if the background color is defined as color
      • isBackgroundColorAsGradient

        public final boolean isBackgroundColorAsGradient()
        Returns true if the background color is defined as gradient.
        Returns:
        true if the background color is defined as gradient
      • isBackgroundColorAsPattern

        public final boolean isBackgroundColorAsPattern()
        Returns true if the background color is defined as canvas pattern.
        Returns:
        true if the background color is defined as canvas pattern
      • getBackgroundColorAsString

        public final String getBackgroundColorAsString()
        Returns the background color of the dataset item.
        Returns:
        the background color of the dataset item.
      • getBackgroundColor

        public final IsColor getBackgroundColor()
        Returns the background color of the dataset item.
        Returns:
        the background color of the dataset item.
      • getBackgroundColorAsGradient

        public final Gradient getBackgroundColorAsGradient()
        Returns the background color as gradient.
        Returns:
        the background color or null if is not a gradient
      • getBackgroundColorAsCanvasGradient

        public final CanvasGradientItem getBackgroundColorAsCanvasGradient()
        Returns the background color as canvas gradient.
        Returns:
        the background color or null if is not a canvas gradient
      • getBackgroundColorAsPattern

        public final Pattern getBackgroundColorAsPattern()
        Returns the background color as pattern.
        Returns:
        the background color or null if is not a pattern
      • getBackgroundColorAsCanvasPattern

        public final CanvasPatternItem getBackgroundColorAsCanvasPattern()
        Returns the background color as canvas pattern.
        Returns:
        the background color or null if is not a canvas pattern
      • setBackgroundColor

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

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

        public final void setBackgroundColor​(CanvasGradientItem backgroundColor)
        Sets the background color as gradient.
        Parameters:
        backgroundColor - the background color as gradient.
      • setBackgroundColor

        public final void setBackgroundColor​(CanvasPatternItem backgroundColor)
        Sets the background color as pattern.
        Parameters:
        backgroundColor - the background color as pattern.
      • getBorderWidth

        public int getBorderWidth()
        Returns the border width of the dataset item in pixels.
        Returns:
        the border width of the dataset item in pixels.
      • setBorderWidth

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

        public final boolean isBorderColorAsColor()
        Returns true if the border color is defined as color.
        Returns:
        true if the border color is defined as color
      • isBorderColorAsGradient

        public final boolean isBorderColorAsGradient()
        Returns true if the border color is defined as gradient.
        Returns:
        true if the border color is defined as gradient
      • getBorderColorAsString

        public final String getBorderColorAsString()
        Returns the color of the dataset item border
        Returns:
        the color of the dataset item border.
      • getBorderColor

        public final IsColor getBorderColor()
        Returns the color of the dataset item border
        Returns:
        the color of the dataset item border
      • getBorderColorAsGradient

        public final Gradient getBorderColorAsGradient()
        Returns the border color as gradient.
        Returns:
        the border color or null if is not a gradient
      • getBorderColorAsCanvasGradient

        public final CanvasGradientItem getBorderColorAsCanvasGradient()
        Returns the border color as canvas gradient.
        Returns:
        the border color or null if is not a canvas gradient
      • setBorderColor

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

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

        public final void setBorderColor​(CanvasGradientItem borderColor)
        Sets the border color as gradient.
        Parameters:
        borderColor - the border color as gradient.
      • createTooltipLabelColor

        public final TooltipLabelColor createTooltipLabelColor()
        Create new TooltipLabelColor filling it with background and border color of dataset element.
        Returns:
        new TooltipLabelColor filling it with background and border color of dataset element
      • inRange

        public final boolean inRange​(double x,
                                     double y,
                                     boolean useFinalPosition)
        Returns if the point passed as the argument is in the element.
        Parameters:
        x - point X value
        y - point Y value
        useFinalPosition - if the position must be calculated with final dimensions or also during the animation.
        Returns:
        true if the point is in the element
      • inXRange

        public final boolean inXRange​(double x,
                                      boolean useFinalPosition)
        Returns if the point X passed as the argument is in the element.
        Parameters:
        x - point X value
        useFinalPosition - if the position must be calculated with final dimensions or also during the animation.
        Returns:
        true if the point X is in the element
      • inYRange

        public final boolean inYRange​(double y,
                                      boolean useFinalPosition)
        Returns if the point Y passed as the argument is in the element.
        Parameters:
        y - point Y value
        useFinalPosition - if the position must be calculated with final dimensions or also during the animation.
        Returns:
        true if the point Y is in the element