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

Programmatically adding a label to a Symbol

Hello, I am evaluating the product, and I would like to add a symbol, a Ellipse for instance, and show on it a Label. How I could Achieve this? I see on the Diagram Builder Sample, that when you add a Ellipse, you are able to set on it a Collection of Labels, but this Collection is not available from code. Sample code: Syncfusion.Windows.Forms.Diagram.Ellipse item = new Syncfusion.Windows.Forms.Diagram.Ellipse(); Syncfusion.Windows.Forms.Diagram.Label label1 = new Syncfusion.Windows.Forms.Diagram.Label(); item.Bounds = new System.Drawing.RectangleF(50, 50, 100, 100); /* This would be an easy way... item.Labels.Add(new Syncfusion.Windows.Forms.Label("My Ellipse Title"); */ this.diagram1.Model.AppendChild(item); Thanks, James

3 Replies

AD Administrator Syncfusion Team April 21, 2006 08:50 AM UTC

Hello James, Thanks for the code snippet. We have a SymbolLabel class which intend to add label to the SymbolNode using AddLabel()method.kindly, refer the Evaluation center articles which would help you to programmatically add a label to the SymbolNode. Also, we have various samples featured with adding labels to the SymbolNodes programmatically. A list of them are, 1. SymbolFactory and IshikawaDiagram Diagram Samples which demonstrates about labeling the SymbolNode using the SymbolLabel class. 2. SimpleFlow and DynamicSymbol sample explains about labeling the SymbolNode using the Label class. Please let us know if you have any further queries , we will be glad to assist you. Regards, Praveena.


PR Prachi May 17, 2007 12:51 PM UTC

how to add label to Bitmapnode programmatically


MF Meera Fathima Syncfusion Team May 23, 2007 12:36 PM UTC


Hello Prachi,

I am sorry about this delay in responding.

Regarding your query, if your intension is to add label to a bitmapnode, you can do this by customizing the BitmapNode class and adding labels property into it. Also you need to override RenderContiguousData() method within the custom bitmapnode class which is used to render labels on bitmap nodes.

Please refer the forum post - http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=61245 to get more details about how to go about with this and let me know if you have any more queries regarding this.

Thanks for your interest in Syncfusion products.

Best Regards,
Meera

Loader.
Live Chat Icon For mobile
Up arrow icon