Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IColorizerValueProvider.GetValue(IHierarchicalItem, Int32) Method

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 IHierarchicalItem

A treemap/sunburst item.

itemIndex 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