Category / Section
How to render the PaletteColorMapping in the SfTreeMap?
1 min read
The TreeMap leaf nodes can be colored by populating the multiple color brushes inside the Colors collection of the PaletteColorMapping.
XAML
<syncfusion:SfTreeMap.LeafColorMapping> <syncfusion:PaletteColorMapping> <syncfusion:PaletteColorMapping.Colors> <SolidColorBrush Color="Red"/> <SolidColorBrush Color="Blue"/> <SolidColorBrush Color="Green"/> <SolidColorBrush Color="Yellow"/> <SolidColorBrush Color="Orange"/> <SolidColorBrush Color="Orchid"/> <SolidColorBrush Color="Brown"/> <SolidColorBrush Color="BlueViolet"/> <SolidColorBrush Color="OrangeRed"/> <SolidColorBrush Color="Magenta"/> <SolidColorBrush Color="Olive"/> <SolidColorBrush Color="Crimson"/> <SolidColorBrush Color="DeepSkyBlue"/> </syncfusion:PaletteColorMapping.Colors> </syncfusion:PaletteColorMapping> </syncfusion:SfTreeMap.LeafColorMapping>
Refer to the following online documentation link for more details on PaletteColorMapping:
https://help.syncfusion.com/winrt/installation-and-deployment
Sample Location for PaletteColorMapping: PaletteColorMapping.zip
XAML
<syncfusion:SfTreeMap> . . . <syncfusion:SfTreeMap.LeafColorMapping> <syncfusion:PaletteColorMapping> <syncfusion:PaletteColorMapping.Colors> <SolidColorBrush Color="Red"/> <SolidColorBrush Color="Blue"/> <SolidColorBrush Color="Green"/> <SolidColorBrush Color="Yellow"/> <SolidColorBrush Color="Orange"/> <SolidColorBrush Color="Orchid"/> <SolidColorBrush Color="Brown"/> <SolidColorBrush Color="BlueViolet"/> <SolidColorBrush Color="OrangeRed"/> <SolidColorBrush Color="Magenta"/> <SolidColorBrush Color="Olive"/> <SolidColorBrush Color="Crimson"/> <SolidColorBrush Color="DeepSkyBlue"/> </syncfusion:PaletteColorMapping.Colors> </syncfusion:PaletteColorMapping> </syncfusion:SfTreeMap.LeafColorMapping> . . . </syncfusion:SfTreeMap>
The following screenshot displays the PaletteColorMapping.
Figure 1: PaletteColorMapping