Skip to main content
All docs
V26.1
  • IColorizerValueProvider.GetValue(IHierarchicalItem, Int32) Method

    Returns a value based on an item and its index.

    Namespace: DevExpress.XtraTreeMap

    Assembly: DevExpress.XtraTreeMap.v26.1.dll

    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