OrgChart JS Documentation

Tags

With tags option you can:

  • Set specific template for tagged nodes
  • Set node as assistant for tagged nodes
  • Set node menu items for tagged nodes
  • Set the node level

Set specific template for tagged nodes. See Multiple Templates in one chart for more details.

Code example:

 
    var chart = new OrgChart(document.getElementById("tree"), {
        tags: {
            Management: {
                template: "rony"
            }
        },     
        nodes: [
            { id: 1, tags: ["Management"] },        
        ...
    });
    


Set node as assistant for tagged nodes. See Assistant for more details.

Code example:

 
    var chart = new OrgChart(document.getElementById("tree"), {
        tags: {
            assistant: {
                template: "mery"
            }
        }
        nodes: [
            { id: 1 },
            { id: 2, pid: 1, tags: ["assistant"] }
        ...
    });     
    


Set node menu items for tagged nodes. See Node Menu Item for more details.

Code example:

 
    var chart = new OrgChart(document.getElementById("tree"), {
        tags:{
            customMenuItems:{
                nodeMenu:{
                    add: {text: "Add New" }
              	}
            }
          },
        ...
    });
    


Set the node level. See Layout for more details.

Code example:

 
    var chart = new OrgChart(document.getElementById("tree"), {
        tags:{
            "subLevels1": {
                subLevels1: 0
            },
          },
        ...
    });