Layout Strategies
By the end of this help topic you will learn about the Layout Strategies which are responsible for data tiling in the RadTreeMap and RadPivotMap controls. *Treemap *algorithms represent hierarchical data sets via recursive subdivision of the initial rectangle. The area of each rectangle in the treemap is proportional to the size of that particular node.
Layout Strategies are always applied to child nodes.
Currently there are two Layout Strategies to visualize the data:
-
Squarified - creates rectangles with best aspect ratio.
-
Slice and Dice - creates rectangles with high aspect ratio and displays them sorted either horizontally or vertically.
The default one is Slice and Dice.
For Slice and Dice algorithm you can specify Orientation (Horizontal, Vertical or Smart) and SortDirection (Ascending or Descending):
<telerik:RadTreeMap>
<telerik:RadTreeMap.LayoutStrategy>
<telerik:SliceDiceStrategy SortDirection="Ascending" Orientation="Smart"/>
</telerik:RadTreeMap.LayoutStrategy>
<telerik:RadTreeMap>
You can instantiate a layout strategy in XAML by using the layout strategy name:
<telerik:RadTreeMap Background="#57391A" BorderThickness="0"
LayoutStrategy="Squarified" Padding="1" />
<telerik:RadPivotMap>
<telerik:RadPivotMap.LayoutStrategy>
<telerik:SquarifiedStrategy/>
</telerik:RadPivotMap.LayoutStrategy>
</telerik:RadPivotMap>
<telerik:GroupDefinition Member="Genre" LayoutStrategy="Squarified" />
<telerik:RadTreeMap ItemsSource="{Binding Data}" LayoutStrategy="Squarified" />