Diagram in code. Nodes laying on top of each other.
{
// this.Show(); <---- WORKS FINE.
int y = 0;
int x = 0;
foreach (var fe in log.FlowElements)
{
var rect = CreateNode(x, y, fe);
diagramModel.Nodes.Add(rect);
x = fe.Level * 150;
y += 100;
}
this.Show(); <-- DOES NOT SHOW DIAGRAM CORRECTLY
}
private Node CreateNode(double x, double y, FlowElement fe)
{
Node n = new Node();
//Custom Label property to the Node
n.LabelTextWrapping = TextWrapping.Wrap;
n.LabelFontWeight = FontWeights.Light;
n.LabelVerticalAlignment = VerticalAlignment.Top;
n.LabelHorizontalAlignment = HorizontalAlignment.Left;
n.Label = DetermineLabel(fe);
n.LabelForeground = Brushes.White;
n.LabelDisplacement = new Point(10, 20);
n.Height = 75;
n.OffsetX = x;
n.OffsetY = y;
return n;
}
Hi Alan,
Thanks for using Syncfusion Products and we regret
for the inconvenience caused.
We have analyzed the reported issue and we are
unable to reproduce the issue with the given information.
Can you please revert us with a sample based on your
application along with the replication procedure to reproduce this issue? This
would be helpful for us to serve you better.
Also, please let us know if you would require any
assistance on this.
Regards,
Ramya
SyncTest_1c7180a5.zip
Hi
Alan,
We
have analyzed your query, we are able to reproduce the reported problem.it is
by design; the DirectedTreeLayout does not arranges the Nodes which are in disconnected
(not connected) state. This is the cause of your problem(node placed on each
other).
Details about Directed-Tree layout:
The
Directed-Tree layout arranges the nodes in a tree-like structure. This layout
can be applied to any diagram that comprises a directed tree graph with unique
root and child nodes. This makes creating diagrams easier because the node
position is determined automatically, based on the connections. However, it is
necessary to specify a layout root for the tree layout. The Directed-Tree
layout will position the nodes based on the layout root.
We
assumed that your requirement is to arrange the Nodes in vertical manner, then
please use TableLayout to achieve your requirement,
If
this response does not satisfy your requirement, please provide us more details
about your requirement. This would help us to serve you better.
Please let us know if you have any concerns.
Regards,
Ramya
- 3 Replies
- 2 Participants
-
AC Alan Churchill
- Jul 11, 2012 12:28 AM UTC
- Jul 18, 2012 01:06 PM UTC