How to: Color TreeMap Using Range Colorizer

To color tree map items using the Range Colorizer, assign a newly created TreeMapRangeColorizer object to the TreeMapControl.Colorizer property. Then, specify the required palette using the TreeMapPaletteColorizerBase.Palette property. Finally, add the required range stops to the TreeMapRangeColorizer.RangeStops property.

void CreateTreeMapColorizer() {
    TreeMapRangeColorizer colorizer = new TreeMapRangeColorizer();
    colorizer.Palette = Palette.CreatePalette( 
        Color.FromArgb(110, 201, 90),
        Color.FromArgb(227, 227, 51),
        Color.FromArgb(255, 93, 23)
    );
    colorizer.RangeStops.Add(1);
    colorizer.RangeStops.Add(64);
    colorizer.RangeStops.Add(256);
    colorizer.RangeStops.Add(1024);

    treeMap.Colorizer = colorizer;
}