menu

ASP.NET MVC

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

    Show / Hide Table of Contents

    Class Label

    Label is a block of text that can be displayed over shapes. Label is used to textually represent an object with a string that can be edited at run time.

    Inheritance
    System.Object
    EJTagHelper
    TextBlock
    Label
    Header
    Inherited Members
    TextBlock.ReadOnly
    TextBlock.Bold
    TextBlock.Italic
    TextBlock.Text
    TextBlock.TextDecoration
    TextBlock.FontSize
    TextBlock.FontFamily
    TextBlock.FontColor
    TextBlock.Offset
    TextBlock.SegmentOffset
    TextBlock.BoundaryConstraints
    TextBlock.Alignment
    TextBlock.RelativeMode
    TextBlock.TextAlign
    TextBlock.WrapText
    TextBlock.Wrapping
    TextBlock.Margin
    TextBlock.Padding
    TextBlock.HorizontalAlignment
    TextBlock.VerticalAlignment
    TextBlock.Mode
    TextBlock.Width
    TextBlock.Opacity
    TextBlock.TextOverflow
    TextBlock.OverflowType
    TextBlock.RotateAngle
    TextBlock.TemplateType
    TextBlock.TemplateId
    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 Label : TextBlock

    Constructors

    Label()

    Initializes a new instance of the Label class.

    Declaration
    public Label()

    Label(Label)

    Initializes a new instance of the Label class.

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

    Properties

    BorderColor

    Gets or sets border color of the label

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

    "transparent"

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, BorderColor = "red" };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Visible = false });
               Node.Labels = Labels;

    BorderWidth

    Gets or sets border width of the label

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

    0

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, BorderWidth = 4 };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Visible = false });
               Node.Labels = Labels;

    Constraints

    Gets or sets constraints of the label

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

    LabelConstraints.None

    Examples
               Node Node = new Node()
               {
                   Name = "node1",
                   Height = 100,
               };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Italic = true, Constraints = LabelConstraints.All });
               Node.Labels = Labels;
               Model.Nodes.Add(Node);

    CssClass

    Gets or sets the stype properties of the label

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

    String.Empty

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, CssClass = "classname" };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Visible = false });
               Node.Labels = Labels;

    DragLimit

    Gets or sets the margin of the label

    Declaration
    [JsonProperty("dragLimit")]
    public LabelMargin DragLimit { get; set; }
    Property Value
    Type Description
    LabelMargin

    DragLimit()

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Italic = true, DragLimit = new DragLimit() { Left = 5 } });
               Node.Labels = Labels;

    FillColor

    Gets or sets fill color of the label

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

    "transparent"

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, fillColor = "red" };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Visible = false });
               Node.Labels = Labels;

    Height

    Gets or sets the height of the label

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

    50

    Examples
                Node Node = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Height = 50 });
               Node.Labels = Labels;

    Hyperlink

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

    Name

    Gets or sets the unique identifier of the label

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

    String.Empty

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", });
               Node.Labels = Labels;

    Visible

    Enables or disables the visibility of the label

    Declaration
    [JsonProperty("visible")]
    public bool Visible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true

    Examples
               Node Node = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Collection Labels = new Collection();
               Labels.Add(new Label() { Text = "Node1", Name = "Node1", Visible = false });
               Node.Labels = Labels;

    Methods

    Clone()

    Performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements.

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

    object

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