We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Give Color to Nodes?

I am trying to make an algorithm for evaluating the viability of the diagram flow 
When I encounter a wrong node in the diagram
I want it to be colored as red. 
Is this possible?

1 Reply

SG Shyam G Syncfusion Team July 21, 2015 08:35 AM UTC

Hi Maverick

Thanks for using Syncfusion products.

Please note that you can set the color for the node at runtime using updateNode API method to achieve your requirement. However we have created a sample in which we have set an color for the node in the click event. please refer the code snippet and sample below.

Code snippet:

$("#diagram").ejDiagram({                                      

                    //define click event

                    click:click,
     });

function click() {

            var diagram = $("#diagram").ejDiagram("instance");

            var node = diagram.selectionList[0];

            if (node) {

                diagram.updateNode(node.name, { fillColor: "red" });

            }
        }  

Sample:http://www.syncfusion.com/downloads/support/forum/119671/ze/simplesample-2079189896

Please let me know if any concerns.

Regards,
Shyam G


Loader.
Live Chat Icon For mobile
Up arrow icon