Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class NodeAnnotationMargin - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class NodeAnnotationMargin

    Represents the space around the annotation content.

    Inheritance
    System.Object
    SfDiagramBase
    DiagramMargin
    NodeAnnotationMargin
    Inherited Members
    DiagramMargin.Bottom
    DiagramMargin.Left
    DiagramMargin.Right
    DiagramMargin.Top
    SfDiagramBase.UpdateCollection(IList, Boolean)
    SfDiagramBase.RandomString(Int32)
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class NodeAnnotationMargin : DiagramMargin
    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection">
    </SfDiagram>
    @code{
      public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>() { };
      protected override void OnInitialized()
      {
        // A node is created and stored in the node array.
        DiagramNode Node = new DiagramNode()
        {
            // Position of the node
            OffsetX = 250,
            OffsetY = 250,
            // Size of the node
            Width = 100,
            Height = 100,
            Style = new NodeShapeStyle() { Fill = "#6BA5D7", StrokeColor = "white" },
            // Initialize port collection
            Annotations = new ObservableCollection<DiagramNodeAnnotation>()
           {
              // An annotation is created and stored in an Annotation collection of Node.
              new DiagramNodeAnnotation() { Content = "Annotation",
              //set margin to label
              Margin = new NodeAnnotationMargin(){ Top = 30, Left = 10, Bottom = 0, Right = 0}}
            }
          };
          NodeCollection.Add(Node);
       }
     }

    Constructors

    NodeAnnotationMargin()

    Represents the space around the annotation content.

    Declaration
    public NodeAnnotationMargin()
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved