Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2589
Treemap margin
posted

Hello,

In your Drilldown sample you can see that the root level has a margin around. As we're going deeper, margin disappears. Is there any way to control that? I would like to set margin to 0 on all levels.

Thank you.

Parents
No Data
Reply
  • 895
    posted

    Hello,

    When the xamTreemap control binds to data, it creates a root node which will contain the nodes from the data source - the margin you are seeing belongs to that root node. In the sample when a drilldown is performed, the root node is changed with a styled node - that's why the margin disappears.

    You can set a style for the default root node through the DefaultStyle property of the xamTreemap control.

    Here is a sample style:

     

                <ig:XamTreemap.DefaultStyle>
                    <Style TargetType="ig:TreemapNode">
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ig:TreemapNode">
                                    <ig:NodesPanel x:Name="NodesPanel" />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ig:XamTreemap.DefaultStyle>
    

    Thanks, Nikolay

Children