Class PathAnnotation
Represents the block of text displayed over the connector.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class PathAnnotation : Annotation, IDiagramObject, ICloneable
Constructors
PathAnnotation()
Initializes a new instance of the PathAnnotation.
Declaration
public PathAnnotation()
PathAnnotation(PathAnnotation)
Creates a new instance of the PathAnnotation from the given PathAnnotation.
Declaration
public PathAnnotation(PathAnnotation src)
Parameters
Type | Name | Description |
---|---|---|
PathAnnotation | src | PathAnnotation |
Properties
Alignment
Gets or sets the alignment of an annotation in a connector. By default, it is aligned at the center.
Declaration
public AnnotationAlignment Alignment { get; set; }
Property Value
Type | Description |
---|---|
AnnotationAlignment | The default value will be Center |
Remarks
Below are the available alignment options |
1. Center, Annotation placed on the connector segment. |
2. Before,Annotation is placed at the top of the connector segment. |
3. After, Annotation is placed at the bottom of the connector segment. |
Examples
Connector connector = new Connector()
{
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
Content = "Connector",
Alignment = AnnotationAlignment.After,
ID = "Annotation",
}
},
};
Displacement
Gets or sets the displacement (margin) of an annotation from its actual position. Applicable only for connector.
Declaration
public DiagramPoint Displacement { get; set; }
Property Value
Type |
---|
DiagramPoint |
Examples
Connector connector = new Connector()
{
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
Content = "Connector",
Offset = 0,
Displacement = new DiagramPoint() { X = 100, Y = 100 }
ID = "Annotation",
}
},
};
Offset
Gets or sets the offset of an annotation in a connector. By default, it is 0.5
Declaration
public double Offset { get; set; }
Property Value
Type |
---|
System.Double |
Examples
Connector connector = new Connector()
{
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
Content = "Connector",
Offset = 0,
ID = "Annotation",
}
},
};
SegmentAngle
Gets or sets the segment angle of the connector.
Declaration
public bool SegmentAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | false, annotation will be rotated in the connector path; Otherwise, true.which means, annotation will be rotated from its position based on the connector segment direction. The default value is false |
Examples
Connector connector = new Connector()
{
SourcePoint = new DiagramPoint() { X = 300, Y = 100 },
TargetPoint = new DiagramPoint() { X = 400, Y = 200 },
// Initialize annotation collection
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
Content = "Connector",
Offset = 0,
Alignment = AnnotationAlignment.After,
ID = "Annotation",
}
},
};
Methods
Clone()
Creates a new PathAnnotation that is a copy of the current annotation.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | PathAnnotation |