Class HeatMapItem
Represents an item hosted within a HeatMapControl. You can add child items to this type as well. When a HeatMapControl's ItemsSource property is set, these types are automatically created for each bound item.
Inheritance
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public class HeatMapItem : HeaderedItemsControl
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:HeatMapControl>
Constructors
HeatMapItem()
Initializes a new instance of the HeatMapItem class.
Declaration
public HeatMapItem()
HeatMapItem(Int32)
Initializes a new instance of the HeatMapItem class. Constructor used to specify the level property of this item.
Declaration
public HeatMapItem(int level)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | level | Specifies the level property. |
Fields
ColorWeightProperty
Identifies the ColorWeight property.
Declaration
public static readonly DependencyProperty ColorWeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ColorWeightValuePathProperty
Identifies the ColorWeightValuePath property.
Declaration
public static readonly DependencyProperty ColorWeightValuePathProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsColorInfoAvailableProperty
Identifies the IsColorInfoAvailable property.
Declaration
public static readonly DependencyProperty IsColorInfoAvailableProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ItemsLayoutModeProperty
Identifies the ItemsLayoutMode property.
Declaration
public static DependencyProperty ItemsLayoutModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ItemVisibilityProperty
Identifies the ItemVisibility dependency property.
Declaration
public static readonly DependencyProperty ItemVisibilityProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LevelProperty
Identifies the Level property.
Declaration
public static readonly DependencyProperty LevelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WeightProperty
Identifies the Weight property.
Declaration
public static readonly DependencyProperty WeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WeightValuePathProperty
Identifies the WeightValuePath property.
Declaration
public static readonly DependencyProperty WeightValuePathProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
ColorWeight
Gets or sets a value indicating whether the background color weight of the item based on which the background of the item is determined. This is usually set indirectly via the ColorWeightValuePath property
Declaration
public double ColorWeight { get; set; }
Property Value
Type |
---|
System.Double |
ColorWeightValuePath
Gets or sets a value that specifies the property name in the bound items from which to retrieve the weight info for that item. By default, this value is derived from the corresponding setting in the parent HeatMapControl.
Declaration
public string ColorWeightValuePath { get; set; }
Property Value
Type |
---|
System.String |
IsColorInfoAvailable
Gets or sets a value indicating whether enough color info is available to determine the background color for this item. This is typically used in your custom HeatMapItem style definitions.
Declaration
public bool IsColorInfoAvailable { get; set; }
Property Value
Type |
---|
System.Boolean |
ItemMeasure
Gets or sets a value indicating more info about the position and size of the item.
Declaration
public HeatMapItemMeasure ItemMeasure { get; set; }
Property Value
Type |
---|
HeatMapItemMeasure |
Remarks
This property can be accessed in the ItemTemplates as shown below.
Then in your custom converter: <DataTemplate x:Key="itemDataTemplate">
<Grid Background="Wheat">
<TextBlock TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource myConverter}}" />
</Grid>
</DataTemplate>
public class MyConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
ContentPresenter cp = value as ContentPresenter;
HeatMapItem item = cp.TemplatedParent as HeatMapItem;
// Show the Area occupied by the item:
return "Area is: " + item.ItemMeasure.AreaByWeight.ToString();
}
}
ItemsLayoutMode
Gets or sets a value indicating whether the layout mode for the child items. By default, this value is derived from the corresponding setting in the parent HeatMapControl.
Declaration
public HeatMapLayoutMode ItemsLayoutMode { get; set; }
Property Value
Type |
---|
HeatMapLayoutMode |
ItemVisibility
Get and Set ItemVisibilityProperty
Declaration
public Visibility ItemVisibility { get; set; }
Property Value
Type |
---|
System.Windows.Visibility |
Level
Gets or sets a value that specifies the level within the hierarchy. This value will be automatically generated if and only if this control is data bound. The top most level is 0.
Declaration
public int Level { get; set; }
Property Value
Type |
---|
System.Int32 |
Weight
Gets or sets a value indicating whether the weight of the item based on which the area it occupies in the resultant layout is determined. This is usually set indirectly via the WeightValuePath property
Declaration
public double Weight { get; set; }
Property Value
Type |
---|
System.Double |
WeightValuePath
Gets or sets a value that specifies the property name in the bound items from which to retrieve the weight info for that item. By default, this value is derived from the corresponding setting in the parent HeatMapControl.
Declaration
public string WeightValuePath { get; set; }
Property Value
Type |
---|
System.String |
Methods
GetContainerForItemOverride()
Method to 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 |
OnHeaderChanged(Object, Object)
The OnHeaderChanged method
Declaration
protected override void OnHeaderChanged(object oldHeader, object newHeader)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldHeader | The old header |
System.Object | newHeader | The new header |