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

Port Labelling

Hi,

Is there a way to add a label to a port?

For instance, I currently have symbols with multiple in/out ports (in on the left, out on the right) but these ports all have different meanings. I'd like to use labels (or something similar) to express this to the user.

Any help would be appreciated!

Regards
Rob

4 Replies

J. J.Nagarajan Syncfusion Team November 17, 2006 02:08 AM UTC

Hi Rob ,

Thanks for your interest in Essential Diagram. Currenty the diagram does not support the Port labels to point out the different ports. However you can use the TextNodes to express these ports to the user. Please refer to the attached screen shot that shows this completely. I hope this will meet your requirement.

Please let me know if you have any questions.

Regards,
Nagaraj

Port Label.zip


RO Rob November 17, 2006 02:38 PM UTC

The issue I have is that there may be any number of ports on either side of the symbol... I'd need to have a way that can dynamically show the user the names of each port.

I'll look into textnodes but at a first glance they may not be suitable (especially when the user makes connections between some of the ports).


RO Rob November 17, 2006 02:38 PM UTC

Almost forgot.. Thanks for your help!


J. J.Nagarajan Syncfusion Team November 22, 2006 12:39 AM UTC

Hi Rob,

Sorry for the delay in getting back to you. You can use the symbol labels and position them at the desired location. You can use label.OffsetX / label.OffsetY properties to position the label at the desired location. This method moves the label by the given X and Y offsets from the control point. Please refer to the following code snippet.

SymbolLabel lbl2 = new SymbolLabel();
lbl2.Text = "Port1";
lbl2.Anchor = BoxPosition.TopRight;
lbl2.OffsetY=25;
this.AppendChild(lbl2);

I have attached the sample that demonstrates this completely. Please kindly refer to it and let me know if you have any questions.

Regards,
Nagaraj

Portlabelling.zip



Loader.
Live Chat Icon For mobile
Up arrow icon