Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Creating a Lane Diagram (Read 1880 times)
catalysis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Aug 2nd, 2009
Creating a Lane Diagram
Aug 2nd, 2009 at 6:43pm
Print Post  
First let me say that this is a really nice control and I think it will be perfect for my application, however I am having some trouble creating a lane diagram like the one in the demo.  Actually, I don't really know where to begin.  I couldn't find much in the documentation and there isn't a code sample with the installation files.

Does anyone have some sample code or could I be pointed in the direction of specifically how to do this?   Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Creating a Lane Diagram
Reply #1 - Aug 3rd, 2009 at 6:49am
Print Post  
Hi,

The lanes in that sample are implemented using locked background nodes. You could create them like this:

Code
Select All
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
	CreateLanes(100, new [] { "Client", "Sales", "Credit", "Invoice" });
}

void CreateLanes(double laneHeight, string[] laneLabels)
{
	for (int i = 0; i < laneLabels.Length; ++i)
	{
		var lane = diagram.Factory.CreateShapeNode(
			0, i * laneHeight, diagram.Bounds.Width, laneHeight);

		lane.Locked = true;
		lane.ZIndex = 0;
		lane.Shape = Shapes.Rectangle;
		lane.Text = laneLabels[i];
		lane.TextFormat = new StringFormat(StringAlignment.Near, StringAlignment.Center);
		lane.FontSize *= 1.5;
	}
}
 



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