Skip to main content
All docs
V25.1
  • HeatmapObjectColorProvider Class

    Converts colors from cell values and applies these colors to cells. This is the default color provider.

    Namespace: DevExpress.XtraCharts.Heatmap

    Assembly: DevExpress.XtraCharts.v25.1.dll

    NuGet Package: DevExpress.Charts

    #Declaration

    public class HeatmapObjectColorProvider :
        HeatmapColorProviderBase

    #Remarks

    Use the HeatmapControl.ColorProvider property to assign a HeatmapObjectColorProvider object to the heatmap.

    When a heatmap uses HeatmapMatrixAdapter to load data, HeatmapObjectColorProvider converts numeric values stored in HeatmapMatrixAdapter.Values to colors.

    When a heatmap uses HeatmapDataSourceAdapter to load data, HeatmapObjectColorProvider converts color data member values to colors. A color data member can store the following values:

    • An integer ARGB color value (431493885)
    • Three or six digit hex code (#fc0, #ff005d)
    • A string color name (SkyBlue)
    • A Color object

    #Examples

    The following example converts heatmap cell values to colors:

    A heatmap painted by an Object Color Provider

    using DevExpress.Utils;
    using DevExpress.XtraCharts;
    using DevExpress.XtraCharts.Heatmap;
    using System.Drawing;
    using System.Windows.Forms;
    namespace HeatmapMatrixAdapterSample {
        public partial class Form1 : Form {
            HeatmapControl heatmap;
            public Form1() {
                InitializeComponent();
    
                heatmap = new HeatmapControl();
                heatmap.Name = "Heatmap";
                this.Controls.Add(heatmap);
                heatmap.Dock = DockStyle.Fill;
    
                HeatmapMatrixAdapter dataAdapter = new HeatmapMatrixAdapter();
                dataAdapter.XArguments = new string[] { "1", "2", "3" };
                dataAdapter.YArguments = new string[] { "A", "B", "C" };
                dataAdapter.Values = new double[,] {
                    { -460545, -1644806, -2031617,},
                    { -5247250, -5185306, -7876870 },
                    { -12156236, -12042869, -16777088 }
                };
                heatmap.DataAdapter = dataAdapter;
    
                heatmap.ColorProvider = new HeatmapObjectColorProvider();
    
                heatmap.AxisY.Reverse = true;
                heatmap.Label.Pattern = "{V}";
                heatmap.Label.Visible = true;
                heatmap.Label.BackColor = Color.FromArgb(120, 255, 255, 255);
            }
        }
    }
    

    #Inheritance

    Object
    DevExpress.XtraCharts.Native.NotificationElement
    HeatmapColorProviderBase
    HeatmapObjectColorProvider
    See Also