Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Regarding Update Visuals (Read 1896 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Regarding Update Visuals
Jun 6th, 2017 at 7:41am
Print Post  
I am working on onUpdateVisuals. I need to set font and text color in update visuals. see the below code. I am able to set font not able to settextcolor as it is not available in Drawing.Text. How can we achieve that?

Code (Javascript)
Select All
            const nodeText = new MindFusion.Drawing.Text(this.nodeAttribute.headingText, config.textRect);
            nodeText.setBounds(config.textRect);

            nodeText.setFont(new MindFusion.Drawing.Font(this.nodeAttribute.fontName, 4, false, true, false));
            nodeText.setTextColor(this.nodeAttribute.headingColor);
 



One more question if the text is lengthy does not fit in to bounds. How can we cut the text and also want show the whole text in tool tip?
  

lengthy_text.PNG ( 7 KB | 92 Downloads )
lengthy_text.PNG
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Regarding Update Visuals
Reply #1 - Jun 6th, 2017 at 8:57am
Print Post  
Hi,

Code (Javascript)
Select All
nodeText.pen = this.nodeAttribute.headingColor; // to set the Text color
nodeText.fitInBounds = true; // will force the string to layout inside its bounds (will cut it, if the space is not enough) 



You can use the DiagramItem.setTooltip method to show text in a tooltip on mouse hovering the item.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: Regarding Update Visuals
Reply #2 - Jun 7th, 2017 at 8:43am
Print Post  
Thanks it works for me.
But i am facing wired problem as you can see in fig attached. Whenever my mouse pointer in on custom node it shows tooltip but the location tooltip far from mouse pointer. Can please let me know how can i correct it? Is there any way we can customize tooltip as well?
  

tooltip.PNG ( 12 KB | 78 Downloads )
tooltip.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Regarding Update Visuals
Reply #3 - Jun 8th, 2017 at 8:03am
Print Post  
Please check if attached build fixes the tooltip. If it doesn't, we might be missing some offsets added by parent elements of the canvas - in such case please attach a test html that reproduces your page structure for our developer to inspect.

Regards,
Slavcho
  

jsdiag.zip ( 166 KB | 120 Downloads )
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint