Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Draw Custom Vertical line on Diagram (Read 3643 times)
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Draw Custom Vertical line on Diagram
Dec 11th, 2017 at 10:57am
Print Post  
Hi,
Can you please tell me how can I draw a custom vertical line on diagram by defining it x y co-ordinates for location and also the length when diagram is loaded or initialized first time, I am using wpf flowcharter
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Draw Custom Vertical line on Diagram
Reply #1 - Dec 11th, 2017 at 11:36am
Print Post  
Hi,

You can use the CreateDiagramLink(point, point) overload through the Diagram.Factory property.

To access the diagram dimensions, use the Bounds property.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Draw Custom Vertical line on Diagram
Reply #2 - Dec 11th, 2017 at 1:40pm
Print Post  
By using the below code which you provided I have created the line, but its an anchor, can i draw it without having arrow and selection property. Thanks
  Point P = new Point();
            P.X = 70;
            P.Y = 0;


            Point P2 = new Point();
            P2.X = 70;
            P2.Y = 200;
            diagram.Factory.CreateDiagramLink(P,P2);
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Draw Custom Vertical line on Diagram
Reply #3 - Dec 11th, 2017 at 2:54pm
Print Post  
Hi,

Modify your code like this:

Code
Select All
var link = diagram.Factory.CreateDiagramLink(P, P2);
link.HeadShape = null; // remove the arrow shape;
link.Locked = true; // prevent interaction with the link. 



Regards,
Lyubo
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Draw Custom Vertical line on Diagram
Reply #4 - Dec 12th, 2017 at 6:21am
Print Post  
thanks
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Draw Custom Vertical line on Diagram
Reply #5 - Jan 19th, 2018 at 7:41am
Print Post  
Hi
   I am facing an issue, when ever i drop the shape node on this custom line it moves or bend , so how can i make it immovable.
thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: Draw Custom Vertical line on Diagram
Reply #6 - Jan 19th, 2018 at 8:50am
Print Post  
Hi,

Set link.AutoRoute to false.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Draw Custom Vertical line on Diagram
Reply #7 - Jan 19th, 2018 at 9:50am
Print Post  
Still its not working , link is bending or moving
           Point h = new Point();
                        h.X = 0;
                        h.Y = 400;


                        Point h2 = new Point();
                        h2.X = 5000;
                        h2.Y = 400;
                        var link2 = diagram.Factory.CreateDiagramLink(h, h2);
                        link2.HeadShape = null;
                        link2.Locked = true;
                        link2.AutoRoute = false;
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: Draw Custom Vertical line on Diagram
Reply #8 - Jan 19th, 2018 at 10:50am
Print Post  
Check if you aren't calling link.Route or diagram.RouteAllLinks yourself from some event handler. Also the above code might create the link bent if diagram.RouteLinks is enabled. In that case, set link.Shape to Polyline and link.SegmentCount to 1 after creation to straighten it back up.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint