Example #1
0
 private void Diagram_BeginNodeLayout(object sender, BeginNodeLayoutEventArgs args)
 {
     if (!args.HasChildNodes)
     {
         args.Type        = ChartType.Left;
         args.Orientation = Orientation.Vertical;
     }
 }
Example #2
0
        void Dia_GetLayoutInfo(object sender, BeginNodeLayoutEventArgs args)
        {
            //Layout the diagram according to the selected type and orientation.
            if ((diagram.LayoutManager.Layout as DirectedTreeLayout).Type == LayoutType.Organization)
            {
                switch (selectedType)
                {
                case "VerticalAlternate":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Alternate;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Vertical;
                    }
                    break;

                case "VerticalLeft":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Left;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Vertical;
                    }
                    break;

                case "VerticalRight":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Right;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Vertical;
                    }
                    break;

                case "HorizontalAlternate":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Alternate;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Horizontal;
                    }
                    break;

                case "HorizontalLeft":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Left;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Horizontal;
                    }
                    break;

                case "HorizontalRight":
                    if (!args.HasChildNodes)
                    {
                        args.Type        = ChartType.Right;
                        args.Orientation = Syncfusion.SfDiagram.Android.Orientation.Horizontal;
                    }
                    break;
                }
            }
        }