We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to add labels to nodes ?

Hi,
When we create diagram in diagramwebcontrol using web application (Essential Diagram)
at that time can we able to give labels/text to the particular nodes


plz reply me.

Thanks .........

1 Reply

MS Mohamed Suhaib Fahad A. Syncfusion Team October 24, 2007 06:43 AM UTC

Hi Sattar,

Thanks for evaluating Syncfusion products.

Yes. Essential diagram allows the users to add any number of text labels to symbols and links. The labels can be created with Label class and added to a node using label collection editor.

The following code snippet illustrates this.

[C#]

// Create Shape
Syncfusion.Windows.Forms.Diagram.Rectangle rec = new Syncfusion.Windows.Forms.Diagram.Rectangle(373, 300, 120, 55);
rec.FillStyle.Type = FillStyleType.LinearGradient;
rec.FillStyle.ForeColor = Color.White;
rec.FillStyle.Color = Color.BlueViolet;

// Create Label
Syncfusion.Windows.Forms.Diagram.Label reclbl =new Syncfusion.Windows.Forms.Diagram.Label();
reclbl.Text = "Rectangle";
reclbl.FontStyle.Size = 13;
reclbl.FontStyle.Bold = true;

// Add label to Shape
rec.Labels.Add(reclbl);

//Add shape to diagram
this.DiagramWebControl1.Model.AppendChild(rec);

Please refer the samples on diagram web that shipped with Essential studio in the below location that displays diagram with labeled nodes.

[Install drive]:\Documents and Settings\Username \My Documents\Syncfusion\EssentialStudio\5.2.0.25\Web\diagram.web\Samples\2.0

You can also refer the Online ASP.NET samples in the below location.

http://www2.syncfusion.com/syncfusion/infrastructure/samplebrowserasp/samples.aspx?version=2_0

And browse through the Diagram.Web section.

Please follow up with any other details in the Direct trac incident you had already created.

Please let us know if you have any other queries.

Regards,
Fahad


Loader.
Live Chat Icon For mobile
Up arrow icon