Class DiagramPoint
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramPoint : DiagramObject, IDiagramObject, ICloneable
Remarks
Used for defining locations in diagrams or graphical representations.
Examples
This example demonstrates how to set the coordinates of a diagram point.
DiagramPoint point = new DiagramPoint(5, 10);
Constructors
DiagramPoint()
Initializes a new instance of the DiagramPoint.
Declaration
public DiagramPoint()
DiagramPoint(DiagramPoint)
Initializes a new instance of the DiagramPoint class, cloning the properties of the specified src
point.
Declaration
public DiagramPoint(DiagramPoint src)
Parameters
Type | Name | Description |
---|---|---|
DiagramPoint | src | The DiagramPoint object from which to copy coordinates. |
DiagramPoint(Nullable<Double>, Nullable<Double>)
Initializes a new instance of the DiagramPoint struct with the specified coordinates.
Declaration
public DiagramPoint(Nullable<double> x, Nullable<double> y)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Double> | x | A System.Double representing the horizontal position of the point. If the value provided is null, the default value of |
System.Nullable<System.Double> | y | A System.Double representing the vertical position of the point. If the value provided is null, the default value of |
Properties
X
Gets or sets the x-coordinate of this DiagramPoint.
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the x-coordinate. The default value is |
Remarks
This property is used to define the horizontal position of the point in a two-dimensional diagram.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Straight,
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Y
Gets or sets the y-coordinate of this DiagramPoint.
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the y-coordinate. The default value is |
Remarks
The Y property should be modified carefully as it affects the position of the DiagramPoint on the diagram's plane.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Straight,
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Methods
Clone()
Creates a new point that is a copy of the current DiagramPoint.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new instance of DiagramPoint that is a copy of the current point. |
Overrides
Examples
This example demonstrates how to clone a diagram point.
DiagramPoint point = new DiagramPoint(5, 10);
DiagramPoint clonedPoint = (DiagramPoint)point.Clone();