Skip to main content
A newer version of this page is available. .
All docs
V21.2

HeatmapControl.CustomizeHeatmapToolTip Event

Occurs before a tooltip is invoked and allows to customize tooltip content based on heatmap cell arguments and values.

Namespace: DevExpress.XtraCharts.Heatmap

Assembly: DevExpress.XtraCharts.v21.2.UI.dll

NuGet Packages: DevExpress.Win.Charts, DevExpress.Win.Design

Declaration

public event CustomizeHeatmapToolTipEventHandler CustomizeHeatmapToolTip

Event Data

The CustomizeHeatmapToolTip event's data class is CustomizeHeatmapToolTipEventArgs. The following properties provide information specific to this event:

Property Description
HeatmapCell Returns a heatmap cell for which a tooltip is shown.
Text Gets or sets the cell tooltip text.
Title Gets or sets the cell tooltip title.

Remarks

The following example shows how to use the HeatmapControl.CustomizeHeatmapToolTip event to modify tooltip content based on the cell value for which the tooltip is shown.

A tooltip customized in the CustomizeHeatmapToolTip handler.

Follow the steps below to enable and customize tooltips:

The code below applies a custom format to tooltip text if a heatmap cell value is more than the specified value:

const int ThresholdValue = 50;

public Form1() {
    InitializeComponent();
    // ...
    heatmap.ToolTipEnabled = true;
    heatmap.ToolTipController = new DevExpress.Utils.ToolTipController { AllowHtmlText = true };
    heatmap.CustomizeHeatmapToolTip += OnHeatmapCustomizeHeatmapToolTip;
}

private void OnHeatmapCustomizeHeatmapToolTip(object sender, CustomizeHeatmapToolTipEventArgs e) {
    double cellValue = (double)e.HeatmapCell.ColorValue;
    if (cellValue > ThresholdValue) {
        e.Title = "Sale Info";
        e.Text = $"Total: <color=green>${cellValue}K</color>";
    }
}
See Also