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

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:


                    //define click event


function click() {

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

            var node = diagram.selectionList[0];

            if (node) {

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



Please let me know if any concerns.

Shyam G

Live Chat Icon For mobile
Up arrow icon