Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Text at the Diagram Link in the middle (Read 3599 times)
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Text at the Diagram Link in the middle
Jun 7th, 2018 at 3:37pm
Print Post  
Hi Lyubo,

I want the text to be placed exactly in the middle of the diagram link.
I use the method:

link.setTextStyle(LinkTextStyle.OverLongestSegment);
link.setTextAlignment(Alignment.Center);

but have I not achieved the desired result.

Regards,
Kuzya
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Text at the Diagram Link in the middle
Reply #1 - Jun 11th, 2018 at 5:22am
Print Post  
Hi,

Try with:

Code (Javascript)
Select All
link.addLabel("This is my text"); 



Regards,
Lyubo
  
Back to top
 
IP Logged
 
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Re: Text at the Diagram Link in the middle
Reply #2 - Jun 15th, 2018 at 8:33am
Print Post  

Hi Lyubo,

it didn't help  Undecided

i need -> Bild1
i have -> Bild2

Regards,
Kuzya
  

bild1.png ( 8 KB | 93 Downloads )
bild1.png
bild2.png ( 26 KB | 89 Downloads )
bild2.png
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Text at the Diagram Link in the middle
Reply #3 - Jun 18th, 2018 at 5:12am
Print Post  
Hi,

The DiagramLink.addLabel method returns an instance of the LinkLabel class that is used to represent the text (the label can also be accessed via the DiagramLink.labels collection). You can specify its general alignment with the setHorizontalAlign and setVerticalAlign property setters, and fine tune its position via the setLinkLengthPosition, setSegmentPosition or setControlPointPosition methods. Check if you aren't setting one of these properties already in your code, so that they affect the labels' positions.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Re: Text at the Diagram Link in the middle
Reply #4 - Jun 18th, 2018 at 5:07pm
Print Post  
Hi,
we're a little bit confused.
We would like to use the native texts of the edges. We like the possibility to position the texts over the longest segment. This does not seem to be possible with the labels.
Our only problem is that when we use the native text of the edges, they are not vertically centered on a horizontal edge. Compare Figures 1 and 2 above.
Unfortunately, we don't seem to be able to influence the native texts of the edges as finely as the labels, do we?
For us it looks like an error in the program that the text on the edges is moved so strangely, because if the text is aligned right or left to the box, then it is centered vertically correctly.


Regards,
Kuzya

bild_1  javaScript
bild_2 -Windows Forms
  

Bild_1_.jpg ( 16 KB | 91 Downloads )
Bild_1_.jpg
bild_2_.jpg ( 16 KB | 100 Downloads )
bild_2_.jpg
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Text at the Diagram Link in the middle
Reply #5 - Jun 19th, 2018 at 1:40pm
Print Post  
Hi,

It really appears that the text bounding box is positioned in reference to its top-left corner right now. Try if the build from this archive works better for you: https://mindfusion.eu/_beta/jsdiag_linktext.zip.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Re: Text at the Diagram Link in the middle
Reply #6 - Jun 28th, 2018 at 12:48pm
Print Post  

Hi Lyubo,

thank you so much  it helped us. Smiley
there is the possibility to center the text inside the edge


i need -> Bild1
i have -> Bild2

Regards,
Kuzya
  

link_1_edited.jpg ( 17 KB | 83 Downloads )
link_1_edited.jpg
link_2_edited.jpg ( 14 KB | 78 Downloads )
link_2_edited.jpg
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Text at the Diagram Link in the middle
Reply #7 - Jun 28th, 2018 at 2:05pm
Print Post  
Hi,

Unfortunately this is not possible with the current build. We'll try to add this for the next release.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Re: Text at the Diagram Link in the middle
Reply #8 - Jun 28th, 2018 at 2:10pm
Print Post  
Hi Lyubo,

When will the next version be released?


Regards,
Lyubo
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Text at the Diagram Link in the middle
Reply #9 - Jul 31st, 2018 at 12:58pm
Print Post  
Hi,

New build here should let you center text by calling link.setTextAlignment(Alignment.Center) -
https://mindfusion.eu/_beta/jsdiag322.zip

We'll be releasing it in a couple of weeks.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint