

For example, you need to print every 20 rows in one page with adding title on every page. Sometimes, you may need to print every n rows in one page, and add title on every page repeatedly too. bodyFont ) // Display, position, and set styles for font getBoundingClientRect ( ) const bodyFont = Chart.

The example below puts a '$' before every row. The label callback can change the text that displays for a given data point. Returns text to render as the footer of the tooltip. Returns text to render before the footer section. Returns text to render after the body section. Returns text to render after an individual label. Default implementation uses the point style from the dataset points. Returns the point style to use instead of color boxes if usePointStyle is true (object with values pointStyle and rotation). Returns the colors for the text of the label for the tooltip item. Returns the colors to render for the tooltip item. Returns text to render for an individual item in the tooltip. This will be called for each item in the tooltip. Returns text to render before an individual label. Returns text to render before the body section. Returns text to render as the title of the tooltip. Returns the text to render before the title.

For functions that return text, arrays of strings are treated as multiple lines of text. This is the primary model that the callback methods interact with. Namespace:, items marked with Yes in the column Dataset override can be overridden per dataset.Ī tooltip item context is generated for each item that appears in the tooltip. For all functions, this will be the tooltip object created from the Tooltip constructor. Namespace:, the tooltip has the following callbacks for providing text. This function can also accept a fourth parameter that is the data object passed to the chart. Must implement at minimum a function that can be passed to (opens new window). # Filter CallbackĪllows filtering of tooltip items. This function can also accept a third parameter that is the data object passed to the chart. # Sort CallbackĪllows sorting of tooltip items. Color boxes are always aligned to the left edge. These options are only applied to text lines. The titleAlign, bodyAlign and footerAlign options define the horizontal position of the text lines with respect to the tooltip box. The following values for the yAlign setting are supported. The following values for the xAlign setting are supported. If these parameters are unset, the optimal caret position is determined. The xAlign and yAlign options define the position of the tooltip caret. You can also define custom position modes. 'nearest' will place the tooltip at the position of the element closest to the event position. 'average' mode will place the tooltip at the average position of the items displayed in the tooltip. Position of the tooltip caret in the Y direction. Position of the tooltip caret in the X direction. This will force the text direction 'rtl' or 'ltr on the canvas for rendering the tooltips, regardless of the css specified on the canvas True for rendering the tooltip from right to left. (size is based on the minimum value between boxWidth and boxHeight). Use the corresponding point style (from dataset options) instead of color boxes, ex: star, triangle etc.

Padding between the color box and the text. Height of the color box if displa圜olors is true. Width of the color box if displa圜olors is true. If true, color boxes are shown in the tooltip. Spacing to add to top and bottom of each footer line.Įxtra distance to move the end of the tooltip arrow away from the tooltip point.Ĭolor to draw behind the colored boxes when multiple items are in the tooltip. Horizontal alignment of the footer text lines. Spacing to add to top and bottom of each tooltip item. Horizontal alignment of the body text lines. Margin to add on bottom of title section. Spacing to add to top and bottom of each title line. Horizontal alignment of the title text lines. If false, the mode will be applied at all times. If true, the tooltip mode applies only when the mouse position intersects with an element. Sets which elements appear in the tooltip. To change the overrides for those chart types, the options are defined in. The bubble, doughnut, pie, polar area, and scatter charts override the tooltip defaults.
