Back to Devexpress

How to: Color TreeMap Using the Gradient Colorizer

windowsforms-115762-controls-and-libraries-treemap-colorizers-examples-how-to-color-treemap-using-the-gradient-colorizer.md

latest1.2 KB
Original Source

How to: Color TreeMap Using the Gradient Colorizer

  • Nov 13, 2018

To color each tree map item depending on its value colors, use the TreeMapGradientColorizer class. Assign an instance of the class to the TreeMapControl.Colorizer property. The TreeMapGradientColorizer.StartColor property allows you to specify the color for an item with the maximum value, and the TreeMapGradientColorizer.EndColor property allows you to specify the color for an item with the minimum value.

csharp
void CreateTreeMapColorizer() {
    treeMap.Colorizer = new TreeMapGradientColorizer {
        StartColor = Color.Black,
        EndColor = Color.White
    };
}
vb
Private Sub CreateTreeMapColorizer()
    treeMap.Colorizer = New TreeMapGradientColorizer With {.StartColor = Color.Black, .EndColor = Color.White}
End Sub