FlowChart.NET - FAQ - Miscellaneous
Overview   Features   Online Demo   Download   Gallery   FAQ   Forum   Online Help   Buy  

    Link auto-routing?

    Prevent routing from changing link anchor?

    Comparison between diagrams?

    Attaching an Object to a Node (Link)?

    Symbol Library?

    Host control inside a node?

    Drawing a shape node from the predefined shapes?

    Linking nodes?

    AnchorPoints for Table-Cells?

 

 

Q:    It seems that link auto-routing does not work when there is a big background shape in the diagram. How can I fix this?

A:   Set the Obstacle property to false:

backgroundShape.Obstacle = false

 

back to top

 

Q:    Is it possible to prevent the auto routing to not move the origin or destination anchor of the link. It is vital that the links stay at the anchor points that the user set.

A:   Setting Anchoring to Keep

	   Diagram.RoutingOptions.Anchoring = Keep 
	   
will do that.

 

back to top

 

Q:     Is it possible to keep a change history of a workflow and compare two versions?

A:   If you need to show the differences between two revisions of the same document, you could implement a change log and show the differences as a list of log entries recorded between some dates.

Enable the Diagram.UndoManager property and the UndoManager.UndoEnabled property and handle the Diagram.ActionRecorded event. In the event handler, create a log entry based on the command being recorded. Add a time-stamp to each record so you can compare the document revision dates with the log records times.

You can make the collection of log entries serializable and store it in the Diagram.Tag.

Another possibility is to assign unique IDs to each DiagramItem.Tag. Then you can compare the document revisions by checking whether items with some ID exist in both versions, so you know if a DiagramItem has been added or removed. If items with some ID exist in both documents, you can further compare their property values, for example, Text, Bounds, and so on.

 

back to top

 

Q:    How to associate custom data with the items in the diagram (nodes and links)?

A:   You can create your own class that derives from ShapeNode and add an ID property to it. To let users create items of your type, set the view.Behavior to Custom and the view.CustomNodeType to typeof(your_node_class). For an example showing how to use custom types with FlowChart.NET, check the IconNodes sample project.

A more simple solution is to assign the id to the item's Tag property. An additional "bonus" is that you will be able to use the FindNode method of Diagram to search for nodes by their tag/ID.

 

back to top

 

Q:    Where can I get a library of hydraulic, pneumatic and electrical symbols for FlowChart.NET?

A:   At this time we do not provide such symbols. Instead you could create your own Shape definitions whose Image property is set to a bitmap or metafile representing the respective symbol. For example, check the symbol library sample "LogicGates", installed in the Flowchart.NET Samples folder.

 

back to top

 

Q:     Is it possible to host more than one control inside a node?

A:   You could create a group of a ShapeNode and few ControlNodes, for example:

ShapeNode container = 
  diagram.Factory.CreateShapeNode(20, 20, 50, 55,
     Shapes.Rectangle);
	
container.HandlesStyle = HandlesStyle.MoveOnly;
ControlNode control1 = 
   new ControlNode(diagramView, new Button());
   
control1.Bounds = 
   new RectangleF(25, 25, 40, 10);
   
diagram.Nodes.Add(control1);ControlNode control2 = 
   new ControlNode(diagramView, new RichTextBox());
   
control2.Bounds = 
   new RectangleF(25, 40, 40, 30);
      
diagram.Nodes.Add(control2); 
control1.AttachTo(container, 
   AttachToNode.TopLeft);
      
control2.AttachTo(container, 
   AttachToNode.TopLeft);
   

 

back to top

 

Q:    How to use the predefined shape templates?

A:   Use the FromId method of the Shape class or the members of the Shapes class. Call the CreateShapeNode method through the Factory property of the Diagram class. Set the Shape property of the new ShapeNode object to one of the predefined shapes:

ShapeNode b1 = 
   diagram1.Factory.CreateShapeNode(5, 52, 20, 30);
   
b1.Shape = Shape.FromId("Decision");

 

back to top

 

Q:    I am adding all my nodes at once (from a database table). Then I link them up by adding all my links (from another database table) with the relevant parent and child nodes. I find that the links don't all connect between the edges of the nodes with some linking to the center of the nodes. Why's that?

A:   If two nodes intersect and a link is drawn between them, the link will initially link their centers. Either create the nodes further from each other before linking them, or create the link as Dynamic to have it recalculate its end points while nodes are moved around. You might also explicitly assign end point positions by using the DiagramLink.ControlPoints collection.

 

back to top

 

Q:     Is it possible to set anchorpoints in a table cell?

A:   Rows can have anchorpoints. In addition, the AnchorPoint objects have a Column. This property has effect when an AnchorPattern is assigned to a table row. That lets you define the anchor point positions relatively to the table cells.

 

back to top

 

   
 
   
Forums: FlowChart.NET, WpfDiagram, DiagramLite, JsDiagram, MasterChart, WebChart, Planner.NET, WpfPlanner, Reporting, ReportingLite
© MindFusion Ltd. 2012