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 Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default List<String>
onAfterLabel(IsChart chart, TooltipItem item)
Returns text to render after an individual label.
If returnsnull
or empty list, it will be ignored.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 returnsnull
or empty list, it will be ignored.default List<String>
onLabel(IsChart chart, TooltipItem item)
Returns text to render for an individual item in the tooltip.
If returnsnull
or empty list, it will be ignored.default TooltipLabelColor
onLabelColor(IsChart chart, TooltipItem item)
Returns the colors and borders to render for the tooltip item.
If returnsnull
, it will be ignored.default TooltipLabelPointStyle
onLabelPointStyle(IsChart chart, TooltipItem item)
Returns the point style to use instead of color boxes ifusePointStyle
is true.
Default implementation uses the point style from the data set points.default IsColor
onLabelTextColor(IsChart chart, TooltipItem item)
Returns the colors for the text of the label for the tooltip item.
If returnsnull
, it will be ignored.
-
-
-
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 returnsnull
or empty list, it will be ignored.- Parameters:
chart
- chart instanceitem
- 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 returnsnull
or empty list, it will be ignored.- Parameters:
chart
- chart instanceitem
- 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 returnsnull
, it will be ignored.- Parameters:
chart
- chart instanceitem
- 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 ifusePointStyle
is true.
Default implementation uses the point style from the data set points.- Parameters:
chart
- chart instanceitem
- 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 returnsnull
, it will be ignored.- Parameters:
chart
- chart instanceitem
- 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 returnsnull
or empty list, it will be ignored.- Parameters:
chart
- chart instanceitem
- tooltip item- Returns:
- label to be applied.
-
-