All docs
V21.2
21.2
21.1
The page you are viewing does not exist in version 21.1. This link will take you to the root page.
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

HeatmapHitInfo Class

Contains information about a specific point within a heatmap.

Namespace: DevExpress.XtraCharts.Heatmap

Assembly: DevExpress.XtraCharts.v21.2.dll

Declaration

[RuntimeObject]
public class HeatmapHitInfo :
    ChartHitInfoBase

The following members accept/return HeatmapHitInfo objects:

Remarks

HeatmapHitInfo objects are created when you call the HeatmapControl.CalcHitInfo method to obtain information about a specific point within the heatmap. This method requires you to pass a test point or its coordinates as a parameter.

The HeatmapHitInfo class properties can be grouped into three categories:

  • The properties that indicate whether the test point resides over a particular view element. For instance, the HeatmapHitInfo.InTitle property indicates whether the test point is over the heatmap title or not;
  • The properties that return heatmap elements themselves (for example, the Title property).
  • The HeatmapHitInfo.HitObject and HeatmapHitInfo.HitObjects properties that identify the topmost element or the collection of all visual elements which contains the test point.

Example

The following example shows how to determine what a heatmap element is in a test point, and collect information related to this element.

A heatmap axis is hit-tested.

Call the HeatmapControl.CalcHitInfo method to obtain information about a specific point within the Heatmap Control. This method returns a HeatmapHitInfo object that contains information related to heatmap elements positioned in the test point.

using DevExpress.Utils;
using DevExpress.XtraCharts;
using DevExpress.XtraCharts.Heatmap;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HeatmapMatrixAdapterSample {
    public partial class Form1 : Form {
        HeatmapControl heatmap;
        ToolTipController toolTipController = new ToolTipController();
        public Form1() {
            InitializeComponent();
            //...
            heatmap.MouseMove += HeatmapMouseMove;
            heatmap.MouseLeave += HeatmapMouseLeave;
        }

        private void HeatmapMouseMove(object sender, MouseEventArgs e) {
            HeatmapHitInfo hitInfo = heatmap.CalcHitInfo(e.Location);
            StringBuilder builder = new StringBuilder();
            if (hitInfo.InAxis) {
                builder.AppendLine($"In axis: {hitInfo.Axis.Name}");
                if (hitInfo.AxisLabelItem != null)
                    builder.AppendLine($"  Label: {hitInfo.AxisLabelItem.Text}");
                if (hitInfo.AxisTitle != null)
                    builder.AppendLine($"  Axis title: {hitInfo.AxisTitle.Text}");
            }
            if (hitInfo.InCell)
                builder.AppendLine($" In cell: X ({hitInfo.Cell.XArgument}), Y ({hitInfo.Cell.YArgument})");
            if (hitInfo.InTitle)
                builder.AppendLine($" In title: {hitInfo.Title.Text}");
            if (hitInfo.InLegend)
                builder.AppendLine($" In legend");

            if (builder.Length > 0)
                toolTipController.ShowHint($"Hit-testing results:\n {builder}", heatmap.PointToScreen(e.Location));
            else
                toolTipController.HideHint();
        }
        private void HeatmapMouseLeave(object sender, System.EventArgs e) {
            toolTipController.HideHint();
        }
    }
}

Inheritance

See Also