Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Autowidth Table Cells (Read 2105 times)
Santosh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 25th, 2015
Autowidth Table Cells
Sep 9th, 2015 at 10:55am
Print Post  
Hi,
How can we set the width of cell to be auto-width? So that, the text wraps itself as per the text content on load of diagram?

In the following diagram,
- The text are having spaces to right
- The bars(orange/green) sometimes overlap the table node
  

1_007.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Autowidth Table Cells
Reply #1 - Sep 9th, 2015 at 12:08pm
Print Post  
Hi,

There is no support for cell auto-width. You can find what size will fit the cell's text by calling diagram.measureString, and then set the table width accordingly:

Code
Select All
var textSize = diagram.measureString(cell.getText(), table.getEffectiveFont());

var r = table.getBounds();
r.width = textSize.width + 2 /* default text padding */ + imageCellWidth;
table.setBounds(r); 



The bars look like something you are custom-drawing, it's up to you to fit them in the table's width (table.getBounds().width).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Santosh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 25th, 2015
Re: Autowidth Table Cells
Reply #2 - Sep 10th, 2015 at 5:46am
Print Post  
Thanks Stoyo. Both problems are resolved Smiley
« Last Edit: Sep 10th, 2015 at 7:15am by Santosh »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint