menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ShapeAnnotation - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ShapeAnnotation

    Defines the textual description of nodes/connectors with respect to bounds Represents the block of text displayed over the node.

    Inheritance
    System.Object
    DiagramObject
    Annotation
    ShapeAnnotation
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    Annotation.AdditionalInfo
    Annotation.Constraints
    Annotation.Content
    Annotation.Height
    Annotation.HorizontalAlignment
    Annotation.Hyperlink
    Annotation.ID
    Annotation.Margin
    Annotation.RotationAngle
    Annotation.Style
    Annotation.UseTemplate
    Annotation.VerticalAlignment
    Annotation.Visibility
    Annotation.Width
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ShapeAnnotation : Annotation, IDiagramObject, ICloneable
    Examples
    Node node = new Node()
    {
        // Position of the node
        OffsetX = 250,
        OffsetY = 250,
        // Size of the node
        Width = 100,
        Height = 100,
        Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
        // Initialize the annotation collection
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() { new ShapeAnnotation { Content = "Node" }, Offset = new DiagramPoint() { X = 0, Y = 0 } },
    };

    Constructors

    ShapeAnnotation()

    Initializes a new instance of the ShapeAnnotation.

    Declaration
    public ShapeAnnotation()

    ShapeAnnotation(ShapeAnnotation)

    Creates a new instance of the ShapeAnnotation from the given ShapeAnnotation.

    Declaration
    public ShapeAnnotation(ShapeAnnotation src)
    Parameters
    Type Name Description
    ShapeAnnotation src

    ShapeAnnotation

    Properties

    Offset

    Gets or sets the position of the annotation to its parent bounds.

    Declaration
    public DiagramPoint Offset { get; set; }
    Property Value
    Type
    DiagramPoint
    Examples
    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() { new ShapeAnnotation { Content = "Node" }, Offset = new DiagramPoint() { X = 0, Y = 0 } },
    };

    RotationReference

    Gets or sets a value indicates whether the annotation rotates along with the node. By default, annotations rotate along with their parent nodes.

    Declaration
    public AnnotationRotationReference RotationReference { get; set; }
    Property Value
    Type Description
    AnnotationRotationReference

    The default value is AnnotationRotationReference.Parent.

    Examples
    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            new ShapeAnnotation 
            { 
                Content = "Node",
                ID = "Annotation",
                RotationReference = AnnotationRotationReference.Page,
            }
        },
    };

    Methods

    Clone()

    Creates a new annotation that is a copy of the current annotation.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    ShapeAnnotation

    Overrides
    Annotation.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved