- 2 minutes to read
This document describes the Colorizers used by the TreeMap control in detail. It consists of the following sections.
- Palette Colorizer
- Gradient Colorizer
- Group Gradient Colorizer
- Range Colorizer
- Custom Colorizer
Colorizers allows you to automatically provide colors for tree map items using a color distribution algorithm. To do this, assign the required colorizer, represented by the TreeMapColorizerBase class descendant to the TreeMapControl.Colorizer property.
After that customize algorithm settings. The next sections describe colorizers and their settings in detail.
This colorizer for each leaf or group tree map item assigns a new color from a palette.
The way how the colorizer provides color is dependent on the TreeMapPaletteColorizer.ColorizeGroups property value. The following table demonstrates the difference.
|The property value.||The resulting image.|
|TreeMapPaletteColorizer.ColorizeGroups = false|
|TreeMapPaletteColorizer.ColorizeGroups = true|
To change a palette used by the colorizer, use the TreeMapPaletteColorizerBase.Palette property.
Refer to the How to: Color Tree Map Using the Palette Colorizer example to learn more.
This colorizer for each leaf tree map item provides a color blended from TreeMapGradientColorizer.StartColor and TreeMapGradientColorizer.EndColor. The color proportion is dependent on item values. The following image demonstrates the TreeMap colored using this colorizer.
Refer to the How to: Color Tree Map Using the Gradient Colorizer example to learn more.
Group Gradient Colorizer
This colorizer provides colors to leaf tree map items using the following principle. For each group, a color from TreeMapPaletteColorizerBase.Palette is assigned. Then, group color is blended with TreeMapGroupGradientColorizer.GradientColor in proportion depending on the item value. The portion of group color is between TreeMapGroupGradientColorizer.Min and TreeMapGroupGradientColorizer.Max values. The following image demonstrates this colorizer in action.
Refer to the How to: Color Tree Map Using the Group Gradient Colorizer example to learn more.
This colorizer assigns color to the tree map item depending on which range tree map item value belongs to. Ranges can be specified using TreeMapRangeColorizer.RangeStops. Colors assigned to ranges are taken from the TreeMapPaletteColorizerBase.Palette. The next image shows the TreeMap colored using this colorizer.
Refer to the How to: Color Tree Map Using Range Colorizer example to learn more.
Refer to the How to: Implement a Custom Colorizer example to learn more.