A newer version of this page is available. Switch to the current version.

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 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.

TreeMapColorizer_Property

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 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 PaletteColorizer_ColorizeGroup_False
TreeMapPaletteColorizer.ColorizeGroups = true PaletteColorizer_ColorizeGroup_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.

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 colored using this colorizer.

GradientColorizer

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.

GroupGradientColorizer

Refer to the How to: Color Tree Map Using the Group Gradient Colorizer example to learn more.

Range Colorizer

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.

RangeColorizer

Refer to the How to: Color Tree Map Using Range Colorizer example to learn more.

Custom Colorizer

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

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

See Also