Reputation: 11
I have a scenario where I'm adding nodes to a root node based on the response of a REST service call.
I'd like to be able to assign the color of the fill of the object based on the node's "type" attribute - which I'm assigning from the REST payload.
For example, I have a root record with 4 address records, and 3 subsidiary records.
I'd live to the able to assign the address records green and the subsidiary records blue, but cannot see where to assign color base on a condition.
Upvotes: 1
Views: 182
Reputation: 53
Try something like this.
var newNode = orgChart.insertNode(parentID, data);
var newNodeId = newNode.id;
orgChart.config.customize[newNodeId] = {color: "red"}
orgChart.loadFromJSON(orgChart.nodes, true);
Upvotes: 1