# 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.

  ![WPF RadTreeMap Squarified Layout Strategy](https://www.telerik.com/products/wpf/documentation/assets/c9ba064bf25f6a8616b61ce26b4240a4/radtreemap_squarified.png)

* **Slice and Dice** - creates rectangles with high aspect ratio and displays them sorted either horizontally or vertically.

  ![WPF RadTreeMap Slice and Dice Layout Strategy](https://www.telerik.com/products/wpf/documentation/assets/a203e69f6f359a8e9dee8345dfcfa3e7/radtreemap_slice_and_dice.png)

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*):

```XAML
<telerik:RadTreeMap>
    <telerik:RadTreeMap.LayoutStrategy>
        <telerik:SliceDiceStrategy SortDirection="Ascending" Orientation="Smart"/>
    </telerik:RadTreeMap.LayoutStrategy>
</telerik:RadTreeMap>
```

Setting the **Orientation** to *Smart* means that the algorithm will automatically choose the most appropriate orientation depending on your data and the available space.

You can instantiate a layout strategy in XAML by using the layout strategy name:

```XAML
<telerik:RadTreeMap Background="#57391A" BorderThickness="0"
	LayoutStrategy="Squarified" Padding="1" />
```

You can also use a TypeConverter that converts strings in \*LayoutStrategy \*using default settings:

```XAML
<telerik:RadPivotMap>
    <telerik:RadPivotMap.LayoutStrategy>
        <telerik:SquarifiedStrategy/>
    </telerik:RadPivotMap.LayoutStrategy>
</telerik:RadPivotMap>
```

Have in mind that the LayoutStrategy may be different for each **TypeDefinition** of **RadTreeMap** or **GroupDefinition** of **RadPivotMap.** You can also set a layout strategy for the topmost level. If you set Squarified for example for the topmost level and you don't specify a strategy for its children - all will inherit the top-most level strategy which in this case is Squarified.

```XAML
<telerik:RadPivotMap ItemsSource="{Binding Data}" LayoutStrategy="Squarified" />
```
