menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Segment

    Show / Hide Table of Contents

    Class Segment

    The path of the connector is defined with a collection of segments.

    Inheritance
    System.Object
    EJTagHelper
    Segment
    Inherited Members
    EJTagHelper.GetControlDetails()
    EJTagHelper.GetControlDetails(String)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.JavaScript.DataVisualization.Models.Diagram
    Assembly: Syncfusion.EJ.dll
    Syntax
    public class Segment : EJTagHelper

    Constructors

    Segment()

    Declaration
    public Segment()

    Segment(Segments)

    Declaration
    public Segment(Segments type)
    Parameters
    Type Name Description
    Segments type

    Properties

    Direction

    Gets or sets direction of orthogonal segment

    Declaration
    [JsonProperty("direction")]
    public string Direction { get; set; }
    Property Value
    Type Description
    System.String

    String.Empty

    Examples
               Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Direction = "bottom", Length = 50 });
               Model.Connectors.Add(Connector);

    Length

    Gets or sets length of the connector segment

    Declaration
    [JsonProperty("length")]
    public double Length { get; set; }
    Property Value
    Type Description
    System.Double

    undefined

    Examples
               Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Direction = "bottom", Length = 50 });
               Model.Connectors.Add(Connector);

    Point

    Gets or sets the end point of bezier/straight segment

    Declaration
    [JsonProperty("point")]
    public DiagramPoint Point { get; set; }
    Property Value
    Type Description
    DiagramPoint

    DiagramPoint

    Examples
               DiagramProperties Model = new DiagramProperties();
               Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Point = new DiagramPoint(75, 110) });
               Model.Connectors.Add(Connector);
               ViewData["diagramModel"] = Model;

    Point1

    Gets or sets the first control point of the bezier segment

    Declaration
    [JsonProperty("point1")]
    public DiagramPoint Point1 { get; set; }
    Property Value
    Type Description
    DiagramPoint

    null

    Examples
               DiagramProperties Model = new DiagramProperties();
               Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Point1 = new DiagramPoint(75, 110) });
               Model.Connectors.Add(Connector);
               ViewData["diagramModel"] = Model;

    Point2

    Gets or sets the second control point of bezier segment

    Declaration
    [JsonProperty("point2")]
    public DiagramPoint Point2 { get; set; }
    Property Value
    Type Description
    DiagramPoint

    null

    Examples
                Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Point2 = new DiagramPoint(75, 110) });
               Model.Connectors.Add(Connector);

    Type

    Gets or sets the type of the connector segment

    Declaration
    [JsonConverter(typeof(StringEnumConverter))]
    [JsonProperty("type")]
    public Segments Type { get; set; }
    Property Value
    Type Description
    Segments

    Segments.Straight

    Examples
               Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Point = new DiagramPoint(75, 150) });
               Model.Connectors.Add(Connector);

    Vector1

    Gets or sets the length and angle between the first control point and the start point of bezier segment

    Declaration
    [JsonProperty("vector1")]
    public Vector Vector1 { get; set; }
    Property Value
    Type Description
    Vector

    null

    Examples
                Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight, Vector1 = new Vector(75, 0) });
               Model.Connectors.Add(Connector);

    Vector2

    Gets or sets the length and angle between the second control point and end point of bezier segment

    Declaration
    [JsonProperty("vector2")]
    public Vector Vector2 { get; set; }
    Property Value
    Type Description
    Vector

    null

    Examples
                Connector Connector = new Connector();
               Connector.Name = "connector1";
               Connector.SourcePoint = new DiagramPoint(100, 100);
               Connector.TargetPoint = new DiagramPoint(200, 200);
               Connector.VerticalAlign = VerticalAlignment.Top;
               Connector.Segments.Add(new Segment() { Type = Segments.Straight,Vector2 = new Vector(75, 180) });
               Model.Connectors.Add(Connector);
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved