Class Tooltips

    • Method Detail

      • getBoxHandler

        public org.pepstock.charba.client.options.BoxHandler getBoxHandler()
      • getEventsOptionHandler

        public EventsOptionHandler getEventsOptionHandler()
        Description copied from interface: HasEvents
        Returns a event handler handler instance to use in the default methods of this interface.
        Specified by:
        getEventsOptionHandler in interface HasEvents
        Returns:
        a event handler handler instance
      • getTextDirectionHandler

        public org.pepstock.charba.client.options.TextDirectionHandler getTextDirectionHandler()
      • getCallbacks

        public TooltipsCallbacks getCallbacks()
        Returns the callbacks element.
        Returns:
        the callbacks
      • setEnabled

        public void setEnabled​(boolean enabled)
        Sets true if tooltips are enabled.
        Parameters:
        enabled - true if tooltips are enabled.
      • isEnabled

        public boolean isEnabled()
        Returns true if tooltips are enabled.
        Specified by:
        isEnabled in interface IsDefaultTooltips
        Returns:
        true if tooltips are enabled.
      • setPosition

        public void setPosition​(IsTooltipPosition position)
        Sets the mode for positioning the tooltip.
        Parameters:
        position - the mode for positioning the tooltip.
      • setBackgroundColor

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

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

        public IsColor getBackgroundColor()
        Returns the background color of the tooltip.
        Returns:
        background color of the tooltip.
      • setXAlign

        public void setXAlign​(TooltipAlign align)
        Sets the alignment of the tooltip caret in the X direction.
        Parameters:
        align - the alignment of the tooltip caret in the X direction.
      • getXAlign

        public TooltipAlign getXAlign()
        Returns the alignment of the tooltip caret in the X direction.
        Specified by:
        getXAlign in interface IsDefaultTooltips
        Returns:
        the alignment of the tooltip caret in the X direction
      • setYAlign

        public void setYAlign​(TooltipAlign align)
        Sets the alignment of the tooltip caret in the Y direction.
        Parameters:
        align - the alignment of the tooltip caret in the Y direction.
      • getYAlign

        public TooltipAlign getYAlign()
        Returns the alignment of the tooltip caret in the Y direction.
        Specified by:
        getYAlign in interface IsDefaultTooltips
        Returns:
        the alignment of the tooltip caret in the Y direction
      • setTitleColor

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

        public void setTitleColor​(String color)
        Sets the title font color.
        Parameters:
        color - title font color.
      • getTitleColor

        public IsColor getTitleColor()
        Returns the title font color.
        Returns:
        title font color
      • setTitleAlign

        public void setTitleAlign​(TextAlign align)
        Sets the title alignment.
        Parameters:
        align - title alignment.
      • setTitleSpacing

        public void setTitleSpacing​(int titleSpacing)
        Sets the spacing to add to top and bottom of each title line.
        Parameters:
        titleSpacing - spacing to add to top and bottom of each title line.
      • getTitleSpacing

        public int getTitleSpacing()
        Returns the spacing to add to top and bottom of each title line.
        Specified by:
        getTitleSpacing in interface IsDefaultTooltips
        Returns:
        spacing to add to top and bottom of each title line.
      • setTitleMarginBottom

        public void setTitleMarginBottom​(int titleMarginBottom)
        Sets the margin to add on bottom of title section.
        Parameters:
        titleMarginBottom - margin to add on bottom of title section.
      • getTitleMarginBottom

        public int getTitleMarginBottom()
        Returns the margin to add on bottom of title section.
        Specified by:
        getTitleMarginBottom in interface IsDefaultTooltips
        Returns:
        margin to add on bottom of title section.
      • setBodyColor

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

        public void setBodyColor​(String color)
        Sets the body font color.
        Parameters:
        color - body font color.
      • getBodyColor

        public IsColor getBodyColor()
        Returns the body font color.
        Returns:
        body font color
      • setBodyAlign

        public void setBodyAlign​(TextAlign align)
        Sets the body alignment.
        Parameters:
        align - body alignment.
      • setBodySpacing

        public void setBodySpacing​(int bodySpacing)
        Sets the spacing to add to top and bottom of each tooltip item.
        Parameters:
        bodySpacing - spacing to add to top and bottom of each tooltip item.
      • getBodySpacing

        public int getBodySpacing()
        Returns the spacing to add to top and bottom of each tooltip item.
        Specified by:
        getBodySpacing in interface IsDefaultTooltips
        Returns:
        spacing to add to top and bottom of each tooltip item.
      • setFooterColor

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

        public void setFooterColor​(String color)
        Sets the footer font color.
        Parameters:
        color - footer font color.
      • getFooterColor

        public IsColor getFooterColor()
        Returns the footer font color.
        Returns:
        footer font color
      • setFooterAlign

        public void setFooterAlign​(TextAlign align)
        Sets the footer alignment.
        Parameters:
        align - footer alignment.
      • setFooterSpacing

        public void setFooterSpacing​(int footerSpacing)
        Sets the spacing to add to top and bottom of each footer line.
        Parameters:
        footerSpacing - spacing to add to top and bottom of each footer line.
      • getFooterSpacing

        public int getFooterSpacing()
        Returns the spacing to add to top and bottom of each footer line.
        Specified by:
        getFooterSpacing in interface IsDefaultTooltips
        Returns:
        spacing to add to top and bottom of each footer line.
      • setFooterMarginTop

        public void setFooterMarginTop​(int footerMarginTop)
        Sets the margin to add before drawing the footer.
        Parameters:
        footerMarginTop - margin to add before drawing the footer.
      • getFooterMarginTop

        public int getFooterMarginTop()
        Returns the margin to add before drawing the footer.
        Specified by:
        getFooterMarginTop in interface IsDefaultTooltips
        Returns:
        margin to add before drawing the footer.
      • setCaretPadding

        public void setCaretPadding​(int caretPadding)
        Sets the extra distance to move the end of the tooltip arrow away from the tooltip point.
        Parameters:
        caretPadding - extra distance to move the end of the tooltip arrow away from the tooltip point.
      • getCaretPadding

        public int getCaretPadding()
        Returns the extra distance to move the end of the tooltip arrow away from the tooltip point.
        Specified by:
        getCaretPadding in interface IsDefaultTooltips
        Returns:
        extra distance to move the end of the tooltip arrow away from the tooltip point.
      • setCaretSize

        public void setCaretSize​(int caretSize)
        Sets the size, in pixels, of the tooltip arrow.
        Parameters:
        caretSize - size, in pixels, of the tooltip arrow.
      • getCaretSize

        public int getCaretSize()
        Returns the size, in pixels, of the tooltip arrow.
        Specified by:
        getCaretSize in interface IsDefaultTooltips
        Returns:
        size, in pixels, of the tooltip arrow.
      • setCornerRadius

        public void setCornerRadius​(int cornerRadius)
        Sets the radius of tooltip corner curves.
        Parameters:
        cornerRadius - radius of tooltip corner curves.
      • setCornerRadius

        public void setCornerRadius​(BarBorderRadius cornerRadius)
        Sets the radius of tooltip corner curves.
        Parameters:
        cornerRadius - radius of tooltip corner curves.
      • getCornerRadius

        public int getCornerRadius()
        Returns the radius of tooltip corner curves.
        Specified by:
        getCornerRadius in interface IsDefaultTooltips
        Returns:
        radius of tooltip corner curves.
      • getCornerRadiusAsObject

        public BarBorderRadius getCornerRadiusAsObject()
        Returns the radius of tooltip corner curves.
        Returns:
        radius of tooltip corner curves.
      • setMultiKeyBackground

        public void setMultiKeyBackground​(IsColor multiKeyBackground)
        Sets the color to draw behind the colored boxes when multiple items are in the tooltip.
        Parameters:
        multiKeyBackground - color to draw behind the colored boxes when multiple items are in the tooltip.
      • setMultiKeyBackground

        public void setMultiKeyBackground​(String multiKeyBackground)
        Sets the color to draw behind the colored boxes when multiple items are in the tooltip.
        Parameters:
        multiKeyBackground - color to draw behind the colored boxes when multiple items are in the tooltip.
      • getMultiKeyBackgroundAsString

        public String getMultiKeyBackgroundAsString()
        Returns the color to draw behind the colored boxes when multiple items are in the tooltip.
        Specified by:
        getMultiKeyBackgroundAsString in interface IsDefaultTooltips
        Returns:
        color to draw behind the colored boxes when multiple items are in the tooltip.
      • getMultiKeyBackground

        public IsColor getMultiKeyBackground()
        Returns the color to draw behind the colored boxes when multiple items are in the tooltip.
        Returns:
        color to draw behind the colored boxes when multiple items are in the tooltip.
      • setDisplayColors

        public void setDisplayColors​(boolean displayColors)
        If true, color boxes are shown in the tooltip.
        Parameters:
        displayColors - if true, color boxes are shown in the tooltip.
      • isDisplayColors

        public boolean isDisplayColors()
        If true, color boxes are shown in the tooltip.
        Specified by:
        isDisplayColors in interface IsDefaultTooltips
        Returns:
        if true, color boxes are shown in the tooltip.
      • setBorderColor

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

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

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

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

        public int getBorderWidth()
        Returns the size of the border.
        Specified by:
        getBorderWidth in interface IsDefaultTooltips
        Returns:
        size of the border.
      • setUsePointStyle

        public void setUsePointStyle​(boolean usePointStyle)
        Sets if to use the corresponding point style (from dataset options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight).
        Parameters:
        usePointStyle - true if to use the corresponding point style (from dataset options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight)
      • isUsePointStyle

        public boolean isUsePointStyle()
        Returns if to use the corresponding point style (from dataset options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight).
        Specified by:
        isUsePointStyle in interface IsDefaultTooltips
        Returns:
        true if to use the corresponding point style (from dataset options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight)
      • setBoxPadding

        public void setBoxPadding​(int boxPadding)
        Sets the padding between the color box and the text.
        Parameters:
        boxPadding - padding between the color box and the text
      • getBoxPadding

        public int getBoxPadding()
        Returns the padding between the color box and the text.
        Specified by:
        getBoxPadding in interface IsDefaultTooltips
        Returns:
        padding between the color box and the text
      • setRtl

        public default void setRtl​(boolean rtl)
        Sets true for rendering the tooltips from right to left.
        Parameters:
        rtl - true for rendering the tooltips from right to left
      • setTextDirection

        public default void setTextDirection​(TextDirection textDirection)
        Sets the text direction of the tooltips that will force the text direction on the canvas for rendering the tooltips, regardless of the CSS specified on the canvas.
        Parameters:
        textDirection - the text direction of the tooltips.
      • getTextDirection

        public default TextDirection getTextDirection()
        Description copied from interface: IsDefaultTextDirectionHandler
        Returns the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas.
        Specified by:
        getTextDirection in interface IsDefaultTextDirectionHandler
        Returns:
        the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas
      • setBoxWidth

        public default void setBoxWidth​(int boxWidth)
        Sets the width of colored box.
        Parameters:
        boxWidth - width of colored box.
      • getBoxWidth

        public default int getBoxWidth()
        Returns the width of colored box.
        Specified by:
        getBoxWidth in interface IsDefaultBoxHandler
        Returns:
        width of colored box.
      • setBoxHeight

        public default void setBoxHeight​(int boxHeight)
        Sets the height of colored box.
        Parameters:
        boxHeight - width of colored box.
      • getBoxHeight

        public default int getBoxHeight()
        Returns the height of colored box.
        Specified by:
        getBoxHeight in interface IsDefaultBoxHandler
        Returns:
        height of colored box.
      • setMode

        public final void setMode​(String name)
        Sets which elements appear in the interaction.
        Parameters:
        name - which elements appear in the interaction.
      • setMode

        public final void setMode​(IsInteractionMode mode)
        Sets which elements appear in the interaction.
        Parameters:
        mode - which elements appear in the interaction.
      • getMode

        public final IsInteractionMode getMode()
        Returns which elements appear in the interaction.
        Returns:
        which elements appear in the interaction.
      • setIntersect

        public final void setIntersect​(boolean intersect)
        if true, the only applies when the mouse position intersects an item on the chart.
        Parameters:
        intersect - if true, the mode only applies when the mouse position intersects an item on the chart.
      • isIntersect

        public final boolean isIntersect()
        if true, the mode only applies when the mouse position intersects an item on the chart.
        Returns:
        if true, the mode only applies when the mouse position intersects an item on the chart.