You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/configuration/tooltip.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,24 +102,26 @@ Allows filtering of [tooltip items](#tooltip-item-context). Must implement at mi
102
102
103
103
Namespace: `options.plugins.tooltip.callbacks`, the tooltip has the following callbacks for providing text. For all functions, `this` will be the tooltip object created from the `Tooltip` constructor.
104
104
105
+
Namespace: `data.datasets[].tooltip.callbacks`, items marked with `Yes` in the column `Dataset override` can be overridden per dataset.
106
+
105
107
All functions are called with the same arguments: a [tooltip item context](#tooltip-item-context). All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.
106
108
107
-
| Name | Arguments | Description
108
-
| ---- | --------- | -----------
109
-
| `beforeTitle` | `TooltipItem[], object` | Returns the text to render before the title.
110
-
| `title` | `TooltipItem[], object` | Returns text to render as the title of the tooltip.
111
-
| `afterTitle` | `TooltipItem[], object` | Returns text to render after the title.
112
-
| `beforeBody` | `TooltipItem[], object` | Returns text to render before the body section.
113
-
| `beforeLabel` | `TooltipItem, object` | Returns text to render before an individual label. This will be called for each item in the tooltip.
114
-
| `label` | `TooltipItem, object` | Returns text to render for an individual item in the tooltip. [more...](#label-callback)
115
-
| `labelColor` | `TooltipItem, Chart` | Returns the colors to render for the tooltip item. [more...](#label-color-callback)
116
-
| `labelTextColor` | `TooltipItem, Chart` | Returns the colors for the text of the label for the tooltip item.
117
-
| `labelPointStyle` | `TooltipItem, Chart` | Returns the point style to use instead of color boxes if usePointStyle is true (object with values `pointStyle` and `rotation`). Default implementation uses the point style from the dataset points. [more...](#label-point-style-callback)
118
-
| `afterLabel` | `TooltipItem, object` | Returns text to render after an individual label.
119
-
| `afterBody` | `TooltipItem[], object` | Returns text to render after the body section.
120
-
| `beforeFooter` | `TooltipItem[], object` | Returns text to render before the footer section.
121
-
| `footer` | `TooltipItem[], object` | Returns text to render as the footer of the tooltip.
122
-
| `afterFooter` | `TooltipItem[], object` | Text to render after the footer section.
109
+
| Name | Arguments | Dataset override | Description
| `beforeTitle` | `TooltipItem[], object` | | Returns the text to render before the title.
112
+
| `title` | `TooltipItem[], object` | | Returns text to render as the title of the tooltip.
113
+
| `afterTitle` | `TooltipItem[], object` | | Returns text to render after the title.
114
+
| `beforeBody` | `TooltipItem[], object` | | Returns text to render before the body section.
115
+
| `beforeLabel` | `TooltipItem, object` | Yes | Returns text to render before an individual label. This will be called for each item in the tooltip.
116
+
| `label` | `TooltipItem, object` | Yes | Returns text to render for an individual item in the tooltip. [more...](#label-callback)
117
+
| `labelColor` | `TooltipItem, Chart` | Yes | Returns the colors to render for the tooltip item. [more...](#label-color-callback)
118
+
| `labelTextColor` | `TooltipItem, Chart` | Yes | Returns the colors for the text of the label for the tooltip item.
119
+
| `labelPointStyle` | `TooltipItem, Chart` | Yes | Returns the point style to use instead of color boxes if usePointStyle is true (object with values `pointStyle` and `rotation`). Default implementation uses the point style from the dataset points. [more...](#label-point-style-callback)
120
+
| `afterLabel` | `TooltipItem, object` | Yes | Returns text to render after an individual label.
121
+
| `afterBody` | `TooltipItem[], object` | | Returns text to render after the body section.
122
+
| `beforeFooter` | `TooltipItem[], object` | | Returns text to render before the footer section.
123
+
| `footer` | `TooltipItem[], object` | | Returns text to render as the footer of the tooltip.
124
+
| `afterFooter` | `TooltipItem[], object` | | Text to render after the footer section.
0 commit comments