Articles in this section
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.

palettecolormapping in treemap

Figure 1: PaletteColorMapping

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied