- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.JavaScript pack. It includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are more details and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Decision Anchor Points
Read 508 times

Benji   Offline
YaBB Newbies
*
Posts: 1
I Love MindFusion!


   
     
 
Decision Anchor Points
May 23rd, 2019 at 1:06pm
 
I'm trying to create a flow diagram with a decision shape.
No matter how much I've tried, I failed to set the anchor point for the decision shape. I always get A (in the attached image), while B is the desired output.

Following is the code snippet I use:
            var diagram = new Diagram();

            ShapeNode n1 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
            ShapeNode n2 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
            ShapeNode n3 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
            ShapeNode n4 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
            ShapeNode n5 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
            
            n2.Shape.AnchorPattern = AnchorPattern.Decision1In3Out;
            n2.Shape = Shapes.Decision;
            n1.Shape = Shapes.Ellipse;
            n5.Shape = Shapes.Ellipse;

            n1.Text = "Start";
            n2.Text = "Hungry";
            n3.Text = "Eat";
            n4.Text = "Sleep";
            n5.Text = "End";

            n1.ResizeToFitText(FitSize.KeepRatio);
            n2.ResizeToFitText(FitSize.KeepRatio);
            n3.ResizeToFitText(FitSize.KeepRatio);
            n4.ResizeToFitText(FitSize.KeepRatio);
            n5.ResizeToFitText(FitSize.KeepRatio);

            var l1 = diagram.Factory.CreateDiagramLink(n1, n2);
            var l2 = diagram.Factory.CreateDiagramLink(n2, n3);
            var l3 = diagram.Factory.CreateDiagramLink(n2, n4);
            var l4 = diagram.Factory.CreateDiagramLink(n3, n4);
            var l5 = diagram.Factory.CreateDiagramLink(n4, n5);


            l2.Text = "Yes";
            l3.Text = "No";

            l3.OriginAnchor = 3;
            l3.AutoRoute = true;

            var layout = new FlowchartLayout();
            layout.Anchoring = Anchoring.Keep;
            layout.Arrange(diagram);

            var visioExporter = new VisioExporter();
            visioExporter.Export(diagram, "test.vdx");
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1744
Gender: male
tech.support


   
     
 
Re: Decision Anchor Points
Reply #1 - May 23rd, 2019 at 3:07pm
 
Try setting VisioExporter.DynamicsOff.

Regards,
Slavcho
Mindfusion
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print