buy now
log in

Q: How can I make the border of a table node thick and red?

A: Use node.setStroke() and tableNode.setStrokeThickness(). They are both inherited from DiagramItem, so you can use them with any type of node.

Q: How can I change the font for all diagram items?

A: You should do this using a style:

var defaultStyle = new Style(); 

Q: How can I wrap text inside nodes?

A: Text inside ShapeNode-s is wrapped by default. If you have nonbreaking text that you need to wrap, you must set the enableStyledText property to true and it will wrap the text on char by char basis:

var shapeNode1 = diagram.getFactory().createShapeNode(new Rect(0, 0, 30, 25));
shapeNode1.setText("Hello from ShapeNode 1!");
Another option is to call ShapeNode.resizeToFitText(). That would guarantee that no word will be cut and the node’s dimensions will accommodate their text.

Q: I would like to place text with hyperlinks inside my tables.

A: In order to do this you should enable styled text for the node:

startNode.setEnableStyledText (true);
startNode.setText("This is <a href="">.....</a>");
Then you can use some HTML-like formatting tags for your text. A list with currently supported text is available here.

Q: How can I handle hyperlinks from text inside my nodes?

A: You can handle the hyperlinkClicked event if you have several links in a node:

// node is a ShapeNode instance
node.setText("test <a href =''>link</a> test and another <a href=””>diagram test</a>");


// attach an event listener to the hyperlinkClicked event
diagram.addEventListener(Events.hyperlinkClicked, onHyperlinkClicked);

function onHyperlinkClicked(sender, args)
If you want your node to represent a single hyperlink that opens when the node is clicked you can store the hyperlink and handle the nodeClicked event:



function onNodeClicked(sender, args)
    // ...;

Copyright © 2001-2019 MindFusion LLC. All rights reserved.
Terms of Use - Contact Us