Colorizers

  • 2 minutes to read

This document describes the Colorizers used by the TreeMap control in detail. It consists of the following sections.

Overview

Colorizers allow you to automatically provide colors for tree map items using a color distribution algorithm. To do this, assign the required colorizer, represented by the ITreeMapColorizer class descendant to the TreeMapControl.Colorizer property.

TreeMapColorizers_PropertyGrid

After that, customize algorithm settings. The next sections describe colorizers and their settings in detail.

Palette Colorizer

This colorizer for each leaf or group tree map item assigns a new color from a palette.

The way the colorizer provides color depends on the TreeMapPaletteColorizer.ColorizeGroups property value. The following table demonstrates the difference.

The property value. The resulting image.
TreeMapPaletteColorizer.ColorizeGroups = false TreeMaPaletteColorizer_ColorByGroups_False
TreeMapPaletteColorizer.ColorizeGroups = true TreeMaPaletteColorizer_ColorByGroups_True

To change a palette used by the colorizer, use the TreeMapPaletteColorizerBase.Palette property.

Refer to the How to: Color TreeMap Using the Palette Colorizer example to learn more.

Gradient Colorizer

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 designed in the How to: Color TreeMap Using the Gradient Colorizer example and colored using this colorizer.

TreeMapGradientColorizer

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 how this colorizer is used in the How to: Color TreeMap Using the Group Gradient Colorizer example.

TreeMapGroupGradientColorizer

Range Colorizer

This colorizer assigns color to the tree map item depending to which range the 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 created in the How to: Color TreeMap Using Range Colorizer example and colored using this colorizer.

TreeMapRangeColorizer

Custom Colorizer

The TreeMap allows you to apply a custom colorizer. To do this, design a class derived from the ITreeMapColorizer class and implement its ITreeMapColorizer.GetItemColor method.

Refer to the How to: Implement a Custom Colorizer example to learn more.

See Also