I'm writing a web-based application using the FlowChart.dll binary. The page is dymanically drawn and can show a wide range of child nodes. Sometimes there can be 1000 or more objects to draw. Currently, they all draw in one vertical line. I would like to have it create a separate branch for each group of 250 child nodes:
Parent Node ---> ChildNode/ChildNode/... (up to 250) | |---> ChildNode/ChildNode/... (up to 250) | |---> ChildNode/ChildNode/.... (to to 250) | v (up to ten groups).
Is there an easy way to do this? I have tried changing the X coordinate for each group, but they all still draw in the same veritcal line. Snipet of code:
Main function for adding child nodes:
Private Function addUndiscoveredClientChild(ByVal parentNode As MindFusion.FlowChartX.Box, ByVal Clients As ArrayList, ByVal parentGroup As MindFusion.FlowChartX.Group) As MindFusion.FlowChartX.BoxCollection
btnVisio.Visible = True btnJPEG.Visible = True Dim bxCollection As New MindFusion.FlowChartX.BoxCollection 'Response.Write("clientgroup: " & iGroupNumber & "<BR>") Dim iCount As Integer = 0
For Each obj As Object In Clients iCount = iCount + 1 Dim iGroup As Integer = 0 Dim childNode As MindFusion.FlowChartX.Box If iCount > 0 And iCount <= 250 Then iGroup = 0 End If If iCount > 250 And iCount <= 500 Then iGroup = 1 End If childNode = fc.CreateBox(iGroup * 50, 0, 100, 50) parentGroup.AttachToCorner(childNode, 0)
Dim link As MindFusion.FlowChartX.Arrow = fc.CreateArrow(parentNode, childNode) link.ArrowHead = MindFusion.FlowChartX.ArrowHead.BowArrow childNode.Image = System.Drawing.Image.FromFile(Server.MapPath("Images\client.jpg")) link.FrameColor = System.Drawing.Color.Yellow link.FillColor = System.Drawing.Color.LightGray childNode.Font = New System.Drawing.Font("Courier", 7) childNode.Tag = obj.ToString childNode.TextFormat.FormatFlags = StringFormatFlags.NoWrap childNode.TextFormat.LineAlignment = StringAlignment.Far childNode.Transparent = True childNode.Text = obj.ToString childNode.TextColor = System.Drawing.Color.SteelBlue 'childNode.PicturePos = MindFusion.WebChart.ImageAlign.TopCenter childNode.ImageAlign = MindFusion.FlowChartX.ImageAlign.TopCenter 'childNode.PicturePos = MindFusion.FlowChartX.ImageAlign.TopCenter rearrangeclient(parentNode, iGroup) bxCollection.Add(childNode) Next
Response.Write("count: " & iCount) Return bxCollection End Function
Code to rearrange the clients:
Private Sub rearrangeclient(ByVal Node As Node, ByVal iGroupNumber As Integer) If treeLayout Is Nothing Then treeLayout = New TreeLayout '(Node, TreeLayoutType.Cascading, False, TreeLayoutArrowType.Cascading2, TreeLayoutDirection.LeftToRight, 40, 15, True, 0, 90) treeLayout.ArrowStyle = TreeLayoutArrowType.Cascading2 treeLayout.KeepGroupLayout = False treeLayout.KeepRootPosition = True treeLayout.Root = Node treeLayout.XGap = 10 + (iGroupNumber + 50) treeLayout.YGap = 50 treeLayout.Type = TreeLayoutType.Cascading treeLayout.NodeDistance = 15 treeLayout.LevelDistance = 40 treeLayout.Direction = TreeLayoutDirection.LeftToRight treeLayout.Anchoring = Anchoring.Ignore treeLayout.ReversedArrows = False 'treeLayout = New TreeLayout(Node, TreeLayoutType.Cascading, False, TreeLayoutArrowType.Cascading3, TreeLayoutDirection.TopToBottom, 110, 5, True, 10, 90)
End If
treeLayout.Arrange(fc) End Sub
Any suggestions would be greatly appreciated.
|