# Tooltips

The Angular Chart provides three types of tooltips—series tooltips that appear on individual data points, shared tooltips that summarize all series values for a category, and crosshair tooltips that display axes values at the pointer position.

The following example demonstrates all three tooltip types in a sales analytics dashboard. Hover over the charts to see each tooltip in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/overview/source.txt)

## Series Tooltip

The series tooltip appears when the user hovers over a data point. It displays the point value and matches the series color by default. Set the [`background`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent#background) and [`border`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent#border) properties to apply a custom tooltip color.

### Configuring the Series Tooltip

To enable tooltips for all series, add the [`kendo-chart-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent) component. To configure the tooltip for a specific series, use the [`kendo-chart-series-item-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/seriestooltipcomponent) component. Series-level settings override the global configuration.

The following example enables tooltips globally and applies a custom background to the Services series tooltip.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/source.txt)

### Customizing the Tooltip Content

The default tooltip content depends on the series type. To customize the text, use the [`format`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent#format) property or specify an Angular template.

#### Using the Format Property

Set the `format` property to apply a format string to the tooltip value. Use the same [number format specifiers](https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#types-of-number-formats) as in label formatting.

The following example formats the tooltip values as currency. The global tooltip uses `{0:c0}`, and the Services series overrides it with a prefixed format.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/custom-format/source.txt)

#### Specifying a Template

Add an `ng-template` tag as a child of the [`kendo-chart-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent) or [`kendo-chart-series-item-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/seriestooltipcomponent) component. The template receives the [`TooltipTemplatePoint`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltiptemplatepoint) context. When you use a template on the global `kendo-chart-tooltip`, apply the [`kendoChartSeriesTooltipTemplate`](https://www.telerik.com/kendo-angular-ui/components/charts/api/seriestooltiptemplatedirective) directive.

The following table lists the most commonly used template context fields:

<table>
    <thead>
        <tr>
            <th width="15%">Field</th>
            <th width="30%">Syntax</th>
            <th width="15%">Type</th>
            <th width="40%">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><code>value</code></td>
            <td><code>let-value="value"</code></td>
            <td><code>any</code></td>
            <td>The data point value.</td>
        </tr>
        <tr>
            <td><code>category</code></td>
            <td><code>let-category="category"</code></td>
            <td><code>string | Date | number</code></td>
            <td>The point category (Categorical series only).</td>
        </tr>
        <tr>
            <td><code>categoryIndex</code></td>
            <td><code>let-categoryIndex="categoryIndex"</code></td>
            <td><code>number</code></td>
            <td>The index of the category (Categorical series only).</td>
        </tr>
        <tr>
            <td><code>series</code></td>
            <td><code>let-series="series"</code></td>
            <td><code>object</code></td>
            <td>The series options including <code>name</code>, <code>color</code>, and <code>type</code>.</td>
        </tr>
        <tr>
            <td><code>dataItem</code></td>
            <td><code>let-dataItem="dataItem"</code></td>
            <td><code>any</code></td>
            <td>The original data item bound to the point.</td>
        </tr>
        <tr>
            <td><code>percentage</code></td>
            <td><code>let-percentage="percentage"</code></td>
            <td><code>number</code></td>
            <td>The value as a percentage (Donut, Pie, and 100% Stacked charts only).</td>
        </tr>
    </tbody>
</table>

> tip The `dataItem` field gives the template access to all properties of the original data object. Bind the series to an array of objects and use `dataItem` to display custom fields such as images, descriptions, or labels.

The following example renders a custom tooltip with an avatar image and formatted revenue for each sales team member.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/custom-template/source.txt)

## Shared Tooltip

The shared tooltip appears when the user hovers over a category and displays a summary of all series values at that point. This tooltip type is available for Categorical charts. To enable it, set the [`shared`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent#shared) property to `true` on the [`kendo-chart-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent) component.

### Configuring the Shared Tooltip

To enable the shared tooltip, set the [`shared`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent#shared) property to `true` on the [`kendo-chart-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent) component. The tooltip then displays all series values for the hovered category in a single popup.

The following example enables the shared tooltip on a multi-series line chart.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/reused-tooltip/source.txt)

### Customizing the Shared Tooltip

The default shared tooltip shows the category name and a list of series values. To customize the content, add an `ng-template` with the [`kendoChartSharedTooltipTemplate`](https://www.telerik.com/kendo-angular-ui/components/charts/api/sharedtooltiptemplatedirective) directive as a child of [`kendo-chart-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltipcomponent).

The following table lists the available template context fields:

<table>
    <thead>
        <tr>
            <th width="15%">Field</th>
            <th width="30%">Syntax</th>
            <th width="15%">Type</th>
            <th width="40%">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><code>category</code></td>
            <td><code>let-category="category"</code></td>
            <td><code>string | Date | number</code></td>
            <td>The hovered category name.</td>
        </tr>
        <tr>
            <td><code>categoryText</code></td>
            <td><code>let-categoryText="categoryText"</code></td>
            <td><code>string</code></td>
            <td>The category name as text.</td>
        </tr>
        <tr>
            <td><code>points</code></td>
            <td><code>let-points="points"</code></td>
            <td><a href="/charts/api/tooltiptemplatepoint"><code>TooltipTemplatePoint[]</code></a></td>
            <td>An array of points for that category.</td>
        </tr>
        <tr>
            <td><code>nameColumn</code></td>
            <td><code>let-nameColumn="nameColumn"</code></td>
            <td><code>boolean</code></td>
            <td>Returns <code>true</code> when the <code>name</code> property of the series is defined.</td>
        </tr>
        <tr>
            <td><code>colorMarker</code></td>
            <td><code>let-colorMarker="colorMarker"</code></td>
            <td><code>boolean</code></td>
            <td>Returns <code>true</code> when one or more series colors are specified and the Chart contains more than one series.</td>
        </tr>
        <tr>
            <td><code>colSpan</code></td>
            <td><code>let-colSpan="colSpan"</code></td>
            <td><code>number</code></td>
            <td>The number of columns covered by the tooltip. Increases by <code>1</code> for each of <code>nameColumn</code> and <code>colorMarker</code> when set to <code>true</code>.</td>
        </tr>
    </tbody>
</table>

> tip Each item in the `points` array is a [`TooltipTemplatePoint`](https://www.telerik.com/kendo-angular-ui/components/charts/api/tooltiptemplatepoint) object. Access `point.series.name`, `point.series.color`, and `point.value` to build custom layouts.

The following example renders a custom shared tooltip with the category name, series names, and formatted values.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/custom-reused-tooltip/source.txt)

## Crosshair Tooltip

The crosshair tooltips appear next to the axis crosshairs and display the current axis value at the pointer position. Enable the crosshair tooltip through the axis-specific crosshair tooltip component.

### In Categorical Charts

For Categorical charts, use the [`kendo-chart-category-axis-item-crosshair-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/categoryaxiscrosshairtooltipcomponent) and [`kendo-chart-value-axis-item-crosshair-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/valueaxiscrosshairtooltipcomponent) components. Set their `visible` property to `true` to display the crosshair tooltips.

The following example enables crosshair tooltips on both the category and value axes.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/crosshair-categorical/source.txt)

### In Scatter Charts

For Scatter charts, use the [`kendo-chart-x-axis-item-crosshair-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/xaxiscrosshairtooltipcomponent) and [`kendo-chart-y-axis-item-crosshair-tooltip`](https://www.telerik.com/kendo-angular-ui/components/charts/api/yaxiscrosshairtooltipcomponent) components. Set their `visible` property to `true` to display the crosshair tooltips.

The following example enables crosshair tooltips on both the X and Y axes.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/crosshair-scatter/source.txt)

## Tooltip Popup Settings

The Chart tooltip renders inside a [Popup](https://www.telerik.com/kendo-angular-ui/components/popup) component. Customize the Popup through the [`popupSettings`](https://www.telerik.com/kendo-angular-ui/components/charts/api/chartcomponent#popupsettings) property on the Chart.

### Setting the Popup Container

By default, the tooltip popup is appended to the `<body>` element. To change this, set the [`popupSettings.appendTo`](https://www.telerik.com/kendo-angular-ui/components/charts/api/chartcomponent#popupsettings) property to a `ViewContainerRef`. This ensures the tooltip stays within the bounds of that container and inherits its styles.

The following example appends the tooltip popup to a specific container element.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/elements/tooltips/popup-container/source.txt)

### Applying a CSS Transformation to the Popup

When [CSS Transforms](https://developer.mozilla.org/en-US/docs/Web/CSS/transform) are applied to the Chart container, move the Popup to the same container to maintain correct tooltip positioning.

The following example applies a scale transform to the Chart and appends the tooltip popup to the Chart container to keep it aligned with the data points.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/charts/chart/tooltip/transforms/source.txt)

## Support and Learning Resources

* [Chart Tooltips Homepage](https://www.telerik.com/kendo-angular-ui/charts#tooltips)
* [Getting Started with the Kendo UI for Angular Chart](https://www.telerik.com/kendo-angular-ui/components/charts/installation/getting-started)
* [API Reference of the Chart](https://www.telerik.com/kendo-angular-ui/components/charts/api)
* [Axes](https://www.telerik.com/kendo-angular-ui/components/charts/elements/axes)
* [Chart Area](https://www.telerik.com/kendo-angular-ui/components/charts/elements/chart-area)
* [Crosshairs](https://www.telerik.com/kendo-angular-ui/components/charts/elements/crosshairs)
* [Error Bars](https://www.telerik.com/kendo-angular-ui/components/charts/elements/error-bars)
* [Labels](https://www.telerik.com/kendo-angular-ui/components/charts/elements/labels)
* [Legend](https://www.telerik.com/kendo-angular-ui/components/charts/elements/legend)
* [Notes](https://www.telerik.com/kendo-angular-ui/components/charts/elements/notes)
* [Panes](https://www.telerik.com/kendo-angular-ui/components/charts/elements/panes)
* [Plot Area](https://www.telerik.com/kendo-angular-ui/components/charts/elements/plot-area)
* [Plot Bands](https://www.telerik.com/kendo-angular-ui/components/charts/elements/plot-bands)
* [Selection](https://www.telerik.com/kendo-angular-ui/components/charts/elements/selection)
* [Series](https://www.telerik.com/kendo-angular-ui/components/charts/elements/series)
* [Title](https://www.telerik.com/kendo-angular-ui/components/charts/elements/title)
* [Getting Started with Kendo UI for Angular (Online Guide)](https://www.telerik.com/kendo-angular-ui/components/getting-started)
* [Getting Started with Kendo UI for Angular (Video Tutorial)](https://www.telerik.com/campaigns/kendo-ui/using-kendo-ui-with-angular-video-tutorial)
* [Video Courses](https://www.telerik.com/kendo-angular-ui/components/getting-started/video-onboarding)
* [Chart Forum](https://www.telerik.com/forums/kendo-angular-ui?tagId=256)
* [Before You Start: All Things Angular (Telerik Blog Post)](https://www.telerik.com/blogs/all-things-angular)
* [Knowledge Base](https://www.telerik.com/kendo-angular-ui/components/knowledge-base)

## Additional Resources

* [Angular Blogs](https://www.telerik.com/blogs/tag/kendo-ui-for-angular)
* [Angular Videos](https://www.telerik.com/videos/kendo-angular-ui)
* [Kendo UI for Angular Roadmap](https://www.telerik.com/support/whats-new/kendo-angular-ui/roadmap)
