OrgChart JS Documentation

S links

slink stands for second links

You can specify two or more second links in one OrgChart JS

Slink options:
 
        var chart = new OrgChart(document.getElementById('tree'), {
            slinks: [
                {from: 4, to: 0, label: 'text'}, 
                {from: 4, to: 5, template: 'blue', label: '4 reports to 3' },
                {from: 2, to: 6, template: 'yellow', label: 'lorem ipsum' },
            ]   
            ...
        });
    
from is the id of the start node
to is the id of the end node

Define label if you want to add text in the middle of the slink, the position of the label depends of the labelPosition of the slink template. labelPosition could be one of the following values "start", "end" and "middle"


Add template if you want to add specifics style to the slink
Slink methods:
 
    chart.addSlink(from, to, label, template)        
 
    chart.removeSlink(from, to)        
Slink templates: