Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unable to set width for LinkLabel (Read 1726 times)
venkatrjv131
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Aug 3rd, 2022
Unable to set width for LinkLabel
Aug 3rd, 2022 at 1:12pm
Print Post  
how can i set the width for linklabel. Instead of showing 2 words per line

Here is code:

const link = factory.createDiagramLink(new Point(x, y), new Point(x + width, y + height));
for (let l = 0; l < texts.length; l++) {
const subLabel = <any>link.addLabel(texts[l]);
subLabel.relativeTo = 1;
subLabel.enableWrap = true;
subLabel.maxWidth = 15;
subLabel.fitInBounds = true;
subLabel.index = 0;
subLabel.horizontalOffset = sp.x + 5;
subLabel.verticalOffset = sp.y;
subLabel.horizontalAlign = MindFusion.Diagramming.Alignment.Near;
subLabel.verticalAlign = MindFusion.Diagramming.Alignment.Center;
}

Can you help me out
  

Screenshot_2022-08-03_184001.png ( 82 KB | 61 Downloads )
Screenshot_2022-08-03_184001.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Unable to set width for LinkLabel
Reply #1 - Aug 3rd, 2022 at 3:28pm
Print Post  
If you mean you need to set larger widths, try scripts from new build here -
https://mindfusion.eu/_beta/jsdiag423.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
venkatrjv131
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Aug 3rd, 2022
Re: Unable to set width for LinkLabel
Reply #2 - Aug 3rd, 2022 at 3:40pm
Print Post  
Thanks for reply @Slavcho,
But how to set width using ur code?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Unable to set width for LinkLabel
Reply #3 - Aug 3rd, 2022 at 3:45pm
Print Post  
Just replace the diagram scripts with ones from the archive, you shouldn't have to change any of your code if you are on a current version.
  
Back to top
 
IP Logged
 
venkatrjv131
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Aug 3rd, 2022
Re: Unable to set width for LinkLabel
Reply #4 - Aug 3rd, 2022 at 5:11pm
Print Post  
Code not working with new scripts
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Unable to set width for LinkLabel
Reply #5 - Aug 3rd, 2022 at 6:37pm
Print Post  
In what way is it not working? What version of the control were you using before trying v4.2.3 scripts?
  
Back to top
 
IP Logged
 
venkatrjv131
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Aug 3rd, 2022
Re: Unable to set width for LinkLabel
Reply #6 - Aug 4th, 2022 at 4:06am
Print Post  
Current version is 3.3.2,
after upgrading to v4.2.3 the code result the same output.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Unable to set width for LinkLabel
Reply #7 - Aug 4th, 2022 at 6:12am
Print Post  
Quote:
If you mean you need to set larger widths, try scripts from new build here -
https://mindfusion.eu/_beta/jsdiag423.zip


Have you set larger maxWidth? that's what these scripts should help with. Otherwise you can't set width smaller than longest word in label's text, as labels can only wrap at word boundaries at this time.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint