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.2.dll
NuGet Package: DevExpress.TreeMap
Declaration
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;
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ValueProvider property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.