Interface TooltipLabelCallback

  • All Known Implementing Classes:
    AbstractTooltipLabelCallback

    public interface TooltipLabelCallback
    The tooltip label configuration is nested below the tooltip configuration using the callbacks key.
    The tooltip has the following callbacks for providing text.
    All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text. This interface takes care about labels.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • onBeforeLabel

        default List<String> onBeforeLabel​(IsChart chart,
                                           TooltipItem item)
        Returns text to render before an individual label.
        This will be called for each item in the tooltip.
        If returns null or empty list, it will be ignored.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        list of labels to be applied.
      • onLabel

        default List<String> onLabel​(IsChart chart,
                                     TooltipItem item)
        Returns text to render for an individual item in the tooltip.
        If returns null or empty list, it will be ignored.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        label to be applied.
      • onLabelColor

        default TooltipLabelColor onLabelColor​(IsChart chart,
                                               TooltipItem item)
        Returns the colors and borders to render for the tooltip item.
        If returns null, it will be ignored.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        label color to be applied.
      • onLabelPointStyle

        default TooltipLabelPointStyle onLabelPointStyle​(IsChart chart,
                                                         TooltipItem item)
        Returns the point style to use instead of color boxes if usePointStyle is true.
        Default implementation uses the point style from the data set points.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        point style to be applied.
      • onLabelTextColor

        default IsColor onLabelTextColor​(IsChart chart,
                                         TooltipItem item)
        Returns the colors for the text of the label for the tooltip item.
        If returns null, it will be ignored.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        label text color to be applied.
      • onAfterLabel

        default List<String> onAfterLabel​(IsChart chart,
                                          TooltipItem item)
        Returns text to render after an individual label.
        If returns null or empty list, it will be ignored.
        Parameters:
        chart - chart instance
        item - tooltip item
        Returns:
        label to be applied.