Skip to main content

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.v24.1.dll

NuGet Package: DevExpress.TreeMap

Declaration

[DefaultValue(null)]
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
public IColorizerValueProvider ValueProvider { get; set; }

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