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.
Inherited Members
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 |