Back to Devexpress

HeatmapCell Class

corelibraries-devexpress-dot-charts-dot-heatmap.md

latest4.2 KB
Original Source

HeatmapCell Class

Contains heatmap cell arguments and value.

Namespace : DevExpress.Charts.Heatmap

Assembly : DevExpress.Charts.v25.2.Core.dll

NuGet Package : DevExpress.Charts.Core

Declaration

csharp
public class HeatmapCell :
    IEquatable<HeatmapCell>
vb
Public Class HeatmapCell
    Implements IEquatable(Of HeatmapCell)

The following members return HeatmapCell objects:

LibraryRelated API Members
Cross-Platform Class LibraryCustomizeHeatmapToolTipEventArgs.HeatmapCell
HeatmapHighlightedItemChangedEventArgs.HeatmapCell
HeatmapHitInfo.Cell
WPF ControlsHeatmapHitInfo.HeatmapCell

Example

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

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:

csharp
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>";
    }
}
vb
Const ThresholdValue As Integer = 50

Public Sub New()
    heatmap.ToolTipEnabled = True
    heatmap.ToolTipController = New DevExpress.Utils.ToolTipController With {
        .AllowHtmlText = True
    }
    heatmap.CustomizeHeatmapToolTip += AddressOf OnHeatmapCustomizeHeatmapToolTip
End Sub

Private Sub OnHeatmapCustomizeHeatmapToolTip(ByVal sender As Object, ByVal e As CustomizeHeatmapToolTipEventArgs)
    Dim cellValue As Double = CDbl(e.HeatmapCell.ColorValue)

    If cellValue > ThresholdValue Then
        e.Title = "Sale Info"
        e.Text = $"Total: <color=green>${cellValue}K</color>"
    End If
End Sub

Inheritance

Object HeatmapCell

See Also

HeatmapCell Members

DevExpress.Charts.Heatmap Namespace