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.

HeatmapMatrixAdapter Class

Loads heatmap data from arrays.

Namespace: DevExpress.XtraCharts.Heatmap

Assembly: DevExpress.XtraCharts.v21.2.dll

Declaration

public class HeatmapMatrixAdapter :
    HeatmapDataAdapterBase,
    IHeatmapMatrixProvider,
    IHeatmapAdapter

Remarks

Use the HeatmapControl.DataAdapter to assign a HeatmapMatrixAdapter to a heatmap. Specify the following adapter properties to load data to the heatmap:

  • XArguments – Specifies a collection of string categories that are displayed along a heatmap’s x-axis.
  • YArguments – Specifies a collection of string categories that are displayed along a heatmap’s y-axis.
  • Values – Defines a two-dimensional numeric matrix of cell values.

Note that you cannot apply the HeatmapObjectColorProvider to a heatmap that uses HeatmapMatrixAdapter.

Example

This example shows how to use arrays of string and numeric values to create a heatmap:

A heatmap that uses a Matrix Adapter

Follow the steps below to create a heatmap:

  1. Add the HeatmapControl to the Form.
  2. Create a HeatmapMatrixAdapter object and assign it to the HeatmapControl.DataAdapter property.
  3. Use the adapter’s XArguments and YArguments properties to populate the heatmap with x- and y-arguments that are displayed along x- and y-axes.
  4. Assign a two-dimensional array of double values to the adapter’s Values property.
  5. Create a HeatmapRangeColorProvider object and assign it to the heatmap’s ColorProvider property. The HeatmapRangeColorProvider paints cells based on the value range to which the cell value belongs.
  6. Add a HeatmapTitle to the heatmap’s Titles collection. Specify the title’s Text property.
  7. Use the heatmap’s Label property to configure cell label options. This example shows how to configure label text format.

View Example

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

namespace HeatmapMatrixData {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();

            HeatmapMatrixAdapter dataAdapter = new HeatmapMatrixAdapter();
            dataAdapter.XArguments = new string[] { "North", "South", "West", "East", "Central" };
            dataAdapter.YArguments = new string[] { "Components", "Clothing", "Bikes", "Accessories" };
            dataAdapter.Values = new double[,] {
                { 21.3, 50.1, 63.2, 64.4, 33.4 },
                { 32.3, 54.4, 81.3, 53.4, 54.9 },
                { 60.3, 49.1, 42.6, 48.4, 65.4 },
                { 45.3, 54.7, 70.3, 66.4, 56.6 }
            };
            heatmap.DataAdapter = dataAdapter;

            Palette palette = new Palette("Custom") {
                Color.White,
                Color.SkyBlue,
                Color.DarkBlue
            };

            HeatmapRangeColorProvider colorProvider = new HeatmapRangeColorProvider() {
                Palette = palette,
                ApproximateColors = true
            };
            colorProvider.RangeStops.Add(new HeatmapRangeStop(0, HeatmapRangeStopType.Percentage));
            colorProvider.RangeStops.Add(new HeatmapRangeStop(20, HeatmapRangeStopType.Absolute));
            colorProvider.RangeStops.Add(new HeatmapRangeStop(40, HeatmapRangeStopType.Absolute));
            colorProvider.RangeStops.Add(new HeatmapRangeStop(60, HeatmapRangeStopType.Absolute));
            colorProvider.RangeStops.Add(new HeatmapRangeStop(90, HeatmapRangeStopType.Absolute));
            colorProvider.RangeStops.Add(new HeatmapRangeStop(1, HeatmapRangeStopType.Percentage));

            heatmap.ColorProvider = colorProvider;

            heatmap.Titles.Add(new HeatmapTitle { Text = "Sales by Categories" });

            heatmap.Label.Visible = true;
            heatmap.Label.Pattern = "{V}";
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HeatmapMatrixAdapter class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
DevExpress.XtraCharts.Native.NotificationElement
HeatmapDataAdapterBase
HeatmapMatrixAdapter
See Also