IColorizerValueProvider.GetValue(IHierarchicalItem, Int32) Method
In This Article
Returns a value based on an item and its index.
Namespace: DevExpress.XtraTreeMap
Assembly: DevExpress.XtraTreeMap.v24.2.dll
NuGet Package: DevExpress.TreeMap
#Declaration
double GetValue(
IHierarchicalItem item,
int itemIndex
)
#Parameters
Name | Type | Description |
---|---|---|
item | IHierarchical |
A treemap/sunburst item. |
item |
Int32 | An item index. |
#Returns
Type | Description |
---|---|
Double | A value that the colorizer uses to determine an item color. |
#Example
The following example shows how to make a treemap colorizer determine item colors based on the bound data source’s “HPI” row values:
((TreeMapColorizerBase)treeMapControl1.Colorizer).ValueProvider = new ColorizerValueProvider();
//...
public class ColorizerValueProvider : IColorizerValueProvider {
double IColorizerValueProvider.GetValue(IHierarchicalItem item, int itemIndex) {
DataRowView row = item.Tag as DataRowView;
if (row != null)
return (double)row["HPI"];
return 0;
}
}
See Also