wpf-11975-controls-and-libraries-charts-suite-chart-control-tooltip-and-crosshair-cursor-tooltip.md
This document defines a tooltip, explains how to use it and lists its main features. Note that the tooltip is available for all diagram types.
If you wish to use an alternative tool to interact with chart data, you can use a crosshair cursor. See the Crosshair Cursor topic to learn more.
This topic consists of the following sections.
A tooltip is a small pop-up rectangle that shows information for hovered series and series points.
As you can see in the image, a tooltip also contains a beak that points to a series point, drawing your attention to this hovered element.
By default, this tooltip displays series point arguments and values, but it is possible to specify custom content as well.
See the Formatting Tooltip Text section to learn more.
Enable tooltips
Show tooltips for series
When you interact with a multiple series chart, it makes sense to get information about a particular series name. Tooltips provide this functionality.
A ToolTipOptions object contains properties allowing you to customize the tooltip’s behavior, as well as specify a tooltip position on a chart.
Use the ChartControl.ToolTipOptions property to gain access to tooltip options.
The following XAML demonstrates how this is done.
<Window x:Class="Tooltip.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
Title="MainWindow" Height="350" Width="525" >
<Grid>
<dxc:ChartControl ToolTipEnabled="True" >
<dxc:ChartControl.ToolTipOptions>
<dxc:ToolTipOptions ShowForSeries="True" ShowForPoints="False">
<dxc:ToolTipOptions.ToolTipPosition>
<dxc:ToolTipMousePosition Location="TopLeft" />
</dxc:ToolTipOptions.ToolTipPosition>
</dxc:ToolTipOptions>
</dxc:ChartControl.ToolTipOptions>
</dxc:ChartControl>
</Grid>
</Window>
A tooltip provides settings that allow you to change its displayed content.
Hide the tooltip’s beak and shadow
Specify a tooltip hint
Use a tooltip pattern
Use a tooltip template
A tooltip has three modes that define its position on a chart.
The image below shows the last tooltip mode with the CrosshairFreePosition.DockCorner property set to TopRight.
Note
A tooltip is automatically displayed without a beak in ToolTipFreePosition mode.
You can get access to the listed tooltip modes via the ToolTipOptions.ToolTipPosition property.
In the ToolTipMousePosition and ToolTipRelativePosition modes, you can specify tooltip position by utilizing the ToolTipPositionWithLocation.Location and ToolTipPosition.Offset properties.
A ChartToolTipController object provides properties that allow you to change tooltip behavior.
The main properties that control tooltip behavior are detailed in the following list.
| Member | Description |
|---|---|
| ChartToolTipController.OpenMode | Specifies the way a tooltip appears on a chart, on either a hover or a mouse click. |
| ChartToolTipController.CloseOnClick | A tooltip is closed when a particular chart element is clicked. |
| ChartToolTipController.AutoPopDelay | Specifies the auto pop up delay before the tooltip appears on a chart. |
| ChartToolTipController.InitialDelay | Specifies the initial delay triggered when a tooltip appears on a diagram. This is a dependency property. |
For additional information on chart interaction, refer to the End-User Capabilities section.
See Also