private BasicShape CreateNode(String name, double width, double height, double offsetx, double offsety, string labelText) { BasicShape node = new BasicShape(); node.Name = name; node.Width = width; node.Height = height; node.OffsetX = offsetx; node.OffsetY = offsety; node.FillColor = "#1BA0E2"; node.BorderColor = "#1BA0E2"; Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label(); label.Text = labelText; label.FontColor = "white"; label.Name = name + "_label"; node.Labels.Add(label); return(node); }
private BasicShape CreateText(String name, double width, double height, double offsetx, double offsety, string labelText) { BasicShape node = new BasicShape(); node.Name = name; node.Width = width; node.Height = height; node.OffsetX = offsetx; node.OffsetY = offsety; node.FillColor = "transparent"; node.BorderWidth = 1; node.BorderColor = "transparent"; node.Constraints = NodeConstraints.Default & ~NodeConstraints.Select; Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label(); label.Text = labelText; label.Name = name + "_label"; node.Labels.Add(label); DiagramWebControl1.Nodes.Add(node); return(node); }
private Node CreateDefaultNode(string text, string fill) { BasicShape node = new BasicShape(); node.Shape = BasicShapes.Rectangle; node.FillColor = fill; node.Width = 120; node.Height = 70; node.BorderWidth = 0; Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label(); label.Offset = new DiagramPoint(0.5F, 0.3F); label.FontColor = "white"; node.Labels.Add(label); Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label1 = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label(); label1.Offset = new DiagramPoint(0.5F, 0.6F); label1.FontColor = "white"; node.Labels.Add(label1); return(node); }
private void ConnectNode(DiagramProperties model, BasicShape targetNode, BasicShape sourceNode, string labelText, bool hasLabel) { Connector connector = new Connector(); connector.Name = "line" + model.Connectors.Count + 1; connector.Segments = new Collection() { new Segment(Segments.Straight) }; connector.TargetNode = targetNode.Name; connector.SourceNode = sourceNode.Name; if (hasLabel) { Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label(); label.FontColor = "black"; label.FillColor = "white"; label.Text = labelText; connector.Labels.Add(label); } connector.SourceDecorator.Shape = DecoratorShapes.Arrow; connector.TargetDecorator.Shape = DecoratorShapes.None; model.Connectors.Add(connector); }