Diagram
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
The diagram component visually represents information. It is also used to create diagrams like flow charts, organizational charts, mind maps, and BPMN either through code or a visual interface.
- C#
- VB.NET
public class Diagram : ej2Base
Public Class Diagram
Inherits ej2Base
Constructors
Diagram()
Constructs a new instance of the Diagram class.
Example:
The following example creates a diagram with two connected nodes through the Options object.
var diagram = new Diagram();
diagram.Options.nodes = new[]
{
new { id = "start", offsetX = 150, offsetY = 80, width = 120, height = 50, annotations = new[] { new { content = "Start" } } },
new { id = "end", offsetX = 150, offsetY = 200, width = 120, height = 50, annotations = new[] { new { content = "End" } } }
};
diagram.Options.connectors = new[]
{
new { id = "startToEnd", sourceID = "start", targetID = "end" }
};
diagram.Dock = DockStyle.Fill;
this.Controls.Add(diagram);
Diagram(options)
Constructs a new instance of the Diagram class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a flow chart using the built-in flow shapes.
var diagram = new Diagram(new
{
nodes = new[]
{
new
{
id = "order", offsetX = 200, offsetY = 80, width = 140, height = 50,
shape = new { type = "Flow", shape = "Terminator" },
annotations = new[] { new { content = "New Order" } }
},
new
{
id = "check", offsetX = 200, offsetY = 200, width = 140, height = 70,
shape = new { type = "Flow", shape = "Decision" },
annotations = new[] { new { content = "In stock?" } }
}
},
connectors = new[]
{
new { id = "orderToCheck", sourceID = "order", targetID = "check" }
}
});
diagram.Dock = DockStyle.Fill;
this.Controls.Add(diagram);