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.

HeatmapAxis.CustomLabelItemTemplate Property

Gets or sets a data template that specifies how to display axis custom labels.

Namespace: DevExpress.Xpf.Charts.Heatmap

Assembly: DevExpress.Xpf.Charts.v21.2.dll

Declaration

public DataTemplate CustomLabelItemTemplate { get; set; }

Property Value

Type Description
DataTemplate

Specifies how to display axis custom labels.

Remarks

To generate custom axis labels from a ViewModel, bind an axis’s CustomLabelItemsSource to a collection of objects that contain custom axis label settings. Use the CustomLabelItemTemplate or CustomLabelItemTemplateSelector property to specify how to display custom axis labels.

Example

The following example generates custom labels for an x-axis:

Custom Labels generated in MVVM style

<dxh:HeatmapControl>
    <dxh:HeatmapControl.DataContext>
        <local:MatrixHeatmapViewModel/>
    </dxh:HeatmapControl.DataContext>
    <!--...-->
    <dxh:HeatmapControl.AxisX>
        <dxh:HeatmapAxis LabelVisibilityMode="AutoGeneratedAndCustom" 
                         CustomLabelItemsSource="{Binding CustomLabels}">
            <dxh:HeatmapAxis.CustomLabelItemTemplate>
                <DataTemplate>
                    <dxc:CustomAxisLabel Value="{Binding AxisValue}" 
                                         Content="{Binding Text}"/>
                </DataTemplate>
            </dxh:HeatmapAxis.CustomLabelItemTemplate>
        </dxh:HeatmapAxis>
    </dxh:HeatmapControl.AxisX>
</dxh:HeatmapControl>
using System.Collections.Generic;
using System.Windows;
namespace HeatmapChart {
    public class MatrixHeatmapViewModel {
        public string[] XArguments { get; set; }
        public string[] YArguments { get; set; }
        public double[,] Values { get; set; }
        public List<CustomLabel> CustomLabels { get; set; }
        public MatrixHeatmapViewModel() {
            XArguments = new string[] { "March", "April", "May", "June", "July" };
            YArguments = new string[] { "Accessories", "Bikes", "Clothing", "Components" };
            Values = new double[,] {
               { 214.3, 530.1, 630.2, 854.4, 313.4 },
               { 321.3, 514.4, 281.3, 533.4, 541.9 },
               { 604.3, 429.1, 632.6, 438.4, 265.4 },
               { 485.3, 544.7, 740.3, 661.4, 516.6 }
            };
            CustomLabels = new List<CustomLabel> {
                new CustomLabel{ AxisValue = "April", Text = "April (04/30)" },
                new CustomLabel{ AxisValue = "May", Text = "May (05/31)" },
            };
        }
    }
    public class CustomLabel {
        public string AxisValue { get; set; }
        public string Text { get; set; }
    }
}
See Also