Class HeatMapControl
Control that lays out bound child items in rectangles whose area is based on their "weight" and whose color is based on their "color weight". Can also be bound to hierarchical data.
Inheritance
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public class HeatMapControl : ItemsControl
Examples
<syncfusion:HeatMapControl Name="heatMap"
LowestWeightColor="ForestGreen"
MedianWeightColor="YellowGreen"
HighestWeightColor="IndianRed" Margin="20">
<!--Adding HeatMapItem-->
<syncfusion:HeatMapItem Weight="1000" ColorWeight="400"
Level="0">
<syncfusion:HeatMapItem Weight="500" Header="US:New York"
ColorWeight="200" Level="1">
<syncfusion:HeatMapItem Header="NY : Albany"
Weight="50" ColorWeight="15" Level="2" />
<syncfusion:HeatMapItem Header="NY : Buffalo"
Weight="60" ColorWeight="20" Level="2" />
<syncfusion:HeatMapItem Header="NY : Rochester"
Weight="55" ColorWeight="12" Level="2" />
</syncfusion:HeatMapItem>
<syncfusion:HeatMapItem Weight="200" Header="US:North
Carolina" ColorWeight="100" Level="1" />
<syncfusion:HeatMapItem Weight="100"
Header="US:Louisiana" ColorWeight="90" Level="1" />
<syncfusion:HeatMapItem Weight="280" Header="US:Florida"
ColorWeight="65" Level="1" />
</syncfusion:HeatMapItem>
<syncfusion:HeatMapItem Weight="800" Header="Canada"
ColorWeight="600" Level="0" />
<syncfusion:HeatMapItem Weight="400" Header="Mexico" Level="0"
ColorWeight="200" />
<syncfusion:HeatMapItem Weight="300" Header="Brazil" Level="0"
ColorWeight="100" />
</syncfusion:HeatMapControl>
Constructors
HeatMapControl()
Initializes a new instance of the HeatMapControl class.
Declaration
public HeatMapControl()
Fields
ColorCalculationLevelProperty
Identifies the ColorCalculationLevel property.
Declaration
public static readonly DependencyProperty ColorCalculationLevelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ColorValuePathProperty
Identifies the ColorValuePath property.
Declaration
public static readonly DependencyProperty ColorValuePathProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HighestWeightColorProperty
Identifies the HighestWeightColor property.
Declaration
public static readonly DependencyProperty HighestWeightColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HighestWeightGradientProperty
Identifies the HighestWeightColor property.
Declaration
public static readonly DependencyProperty HighestWeightGradientProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsGradientBrushProperty
Identifies the IsGradientBrush dependency property.
Declaration
public static readonly DependencyProperty IsGradientBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ItemsLayoutModeProperty
Identifies the ItemsLayoutMode property.
Declaration
public static DependencyProperty ItemsLayoutModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LabelFontSizeProperty
Identifies the LabelFontSize dependency property.
Declaration
public static readonly DependencyProperty LabelFontSizeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LowestWeightColorProperty
Identifies the LowestWeightColor property.
Declaration
public static readonly DependencyProperty LowestWeightColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LowestWeightGradientProperty
Identifies the LowestWeightGradient dependency property.
Declaration
public static readonly DependencyProperty LowestWeightGradientProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MedianWeightColorProperty
Identifies the MedianWeightColor property.
Declaration
public static readonly DependencyProperty MedianWeightColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MedianWeightGradientProperty
Identifies the MedianWeightColor property.
Declaration
public static readonly DependencyProperty MedianWeightGradientProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MedianWeightProperty
Identifies the MedianWeight property.
Declaration
public static readonly DependencyProperty MedianWeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
PreferredItemsPanelHeightProperty
Identifies the PreferredItemsPanelHeight property.
Declaration
public static readonly DependencyProperty PreferredItemsPanelHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
PreferredItemsPanelWidthProperty
Identifies the PreferredItemsPanelWidth property.
Declaration
public static readonly DependencyProperty PreferredItemsPanelWidthProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
TextIntersectActionProperty
Identifies the TextIntersectAction dependency property.
Declaration
public static readonly DependencyProperty TextIntersectActionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WeightValuePathProperty
Identifies the WeightValuePath property.
Declaration
public static readonly DependencyProperty WeightValuePathProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
ColorCalculationLevel
Gets or sets a value indicating the items at a level (when bound to hierarchical data) for which the ColorWeight should be processed. Default is -1, indicating this will be processed for all leaf nodes in the hierarchy. 0 indicates the top level of items in the bound hierarchy and so on. If adding HeatMapItems manually, make sure to set their Level property appropriately. This is a dependency property.
Declaration
public int ColorCalculationLevel { get; set; }
Property Value
Type |
---|
System.Int32 |
ColorValuePath
Gets or sets a path to a value on the source object to serve as the "color weight" of the object. This is a dependency property. This is used for items at all levels. Can be overriden for items at specific levels through the corresponding HeatMapItem's setting.
Declaration
public string ColorValuePath { get; set; }
Property Value
Type |
---|
System.String |
ColorWeightsInfo
Gets or sets a value indicating the computed information about the low and high colors in the bound items.
Declaration
public ColorWeightsInfo ColorWeightsInfo { get; set; }
Property Value
Type |
---|
ColorWeightsInfo |
HighestWeightColor
Gets or sets a value indicating the color that will be used on the item with the highest color weight. This is a dependency property. Default is Green.
Declaration
public Color HighestWeightColor { get; set; }
Property Value
Type |
---|
System.Windows.Media.Color |
HighestWeightGradient
Get and Set HighestWeightGradientProperty
Declaration
public Brush HighestWeightGradient { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
IsGradientBrush
Get and Set IsGradientBrushProperty
Declaration
public bool IsGradientBrush { get; set; }
Property Value
Type |
---|
System.Boolean |
ItemsLayoutMode
Gets or sets a value indicating the mode in which items should be laid out. This setting will be applied at all levels. To customize this for specific level, check the corresponding HeatMapItem setting. Default value is HeatMapLayoutMode.Squarified. This is a dependency property.
Declaration
public HeatMapLayoutMode ItemsLayoutMode { get; set; }
Property Value
Type |
---|
HeatMapLayoutMode |
LabelFontSize
Get and Set LabelFontSizeProperty
Declaration
public double LabelFontSize { get; set; }
Property Value
Type |
---|
System.Double |
LowestWeightColor
Gets or sets a value indicating the color that will be used on the item with the lowest color weight. This is a dependency property. Default is Cornsilk.
Declaration
public Color LowestWeightColor { get; set; }
Property Value
Type |
---|
System.Windows.Media.Color |
LowestWeightGradient
Get and Set LowestWeightGradientProperty
Declaration
public Brush LowestWeightGradient { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
MedianWeight
Gets or sets a value indicating the "median color weight" on which the MedianWeightColor will be applied. The valid values for this property are between 0 to 100. Default is 50. This is a dependency property.
Declaration
public int MedianWeight { get; set; }
Property Value
Type |
---|
System.Int32 |
MedianWeightColor
Gets or sets a value indicating the color that will be used on the item with the median color weight (see MedianWeight. This is a dependency property. Default is Yellow.
Declaration
public Color MedianWeightColor { get; set; }
Property Value
Type |
---|
System.Windows.Media.Color |
MedianWeightGradient
Get and Set MedianWeightGradientProperty
Declaration
public Brush MedianWeightGradient { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
PreferredItemsPanelHeight
Gets or sets a value indicating the preferred height you want to use for groups when bound to a grouped CollectionViewSource. Default is 300. This is a dependency property.
Declaration
public double PreferredItemsPanelHeight { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
Normally, this control simply divides the available space between all the items. But, when bound to a CollectionViewSource with groups, the ItemsControl implementation requires you to specify a width and height for displaying a group. This property is used for that.
PreferredItemsPanelWidth
Gets or sets a value indicating the preferred width you want to use for groups when bound to a grouped CollectionViewSource. Default is 300. This is a dependency property.
Declaration
public double PreferredItemsPanelWidth { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
Normally, this control simply divides the available space between all the items. But, when bound to a CollectionViewSource with groups, the ItemsControl implementation requires you to specify a width and height for displaying a group. This property is used for that.
TextIntersectAction
Get and Set TextIntersectActionProperty
Declaration
public TextIntersectActions TextIntersectAction { get; set; }
Property Value
Type |
---|
TextIntersectActions |
WeightValuePath
Gets or sets a path to a value on the source object to serve as the "weight" of the object. This is a dependency property. This is used for items at all levels. Can be overriden for items at specific levels through the corresponding HeatMapItem's setting.
Declaration
public string WeightValuePath { get; set; }
Property Value
Type |
---|
System.String |
Methods
GetContainerForItemOverride()
Get Container For Item Override
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
System.Windows.DependencyObject | The HeatMapItem |
IsItemItsOwnContainerOverride(Object)
Method to check whether Is Item Its Own Container Override
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The object item |
Returns
Type | Description |
---|---|
System.Boolean | The HeatMapItem |
OnItemsSourceChanged(IEnumerable, IEnumerable)
Called when OnItemsSourceChanged
Declaration
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | oldValue | The old value |
System.Collections.IEnumerable | newValue | The new value |