Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How we can create diagram like Database diagrams - ER diagram (Read 6590 times)
Todkar
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 20
Joined: Jun 24th, 2013
How we can create diagram like Database diagrams - ER diagram
Oct 7th, 2013 at 5:59am
Print Post  
Hi,
I am trying to create ER diagram like database diagram [Find the attached sample image];
but not yet succeed.
can you please help me on same;
which approach should I follow to create diagram like ER / Database diagram.


Is any layout provided for ER diagram ?

I am using Silverlight + MindFusion latest versions

it will good if you provide me sample example.

Thanks a lot,
Jayraj




  

ER_Diagram_Database_diagram__2013-10-07_11-22-36.jpg (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How we can create diagram like Database diagrams - ER diagram
Reply #1 - Oct 7th, 2013 at 8:58am
Print Post  
Hi,

You could create TableNodes to display tabular data such as class members or DB field definitions. Arrange them using OrthogonalLayout, or another layout combined with OthogonalRouter. Here's a sample diagram:

Code
Select All
for (int i = 0; i < 10; i++)
{
	var table = diagram.Factory.CreateTableNode(0, 0, 100, 100,
		2 /* columns */, 5 /* rows */);
	for (int r = 0; r < 5; r++)
	{
		table[0, r].Text = "field " + r;
		table[1, r].Text = "int";
	}
}

for (int i = 0; i < 10; i++)
{
	int d1 = (i * 7 + 2) % diagram.Nodes.Count;
	if (i == d1)
		continue;
	diagram.Factory.CreateDiagramLink(
		diagram.Nodes[i], diagram.Nodes[d1]);

	int d2 = (i * 2 + 1) % diagram.Nodes.Count;
	if (i == d2)
		continue;
	diagram.Factory.CreateDiagramLink(
		diagram.Nodes[i], diagram.Nodes[d2]);
}

new OrthogonalLayout().Arrange(diagram);

/*var ll = new LayeredLayout();
ll.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal;
ll.Arrange(diagram);*/

new OrthogonalRouter().Arrange(diagram);
 





I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint