TreeMapColorizerBase.ValueProvider Property

Gets or sets a provider of values the colorizer uses to determine colors for treemap items.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v20.1.dll

Declaration

[DefaultValue(null)]
public IColorizerValueProvider ValueProvider { get; set; }
<DefaultValue(Nothing)>
Public Property ValueProvider As IColorizerValueProvider

Property Value

Type Default Description
IColorizerValueProvider

null

An object of a class that implements the IColorizerValueProvider interface.

Remarks

Treemap colorizers uses item values (TreeMapItem.Value, TreeMapFlatDataAdapter.ValueDataMember, or HierarchicalDataMapping.ValueDataMember) to determine colors. You can use the ValueProvider property to specify a custom value source for a colorizer.

If ValueProvider is specified, a custom colorizer also uses its returned values to determine colors.

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