Simple sub orientation - OrgChart JS
by Serhii Matrunchyk
HTML
<script src="https://balkangraph.com/js/latest/OrgChart.js"></script>
<div id="tree"/>
CSS
html, body{
width: 100%;
height: 100%;
padding: 0;
margin:0;
overflow: hidden;
font-family: Helvetica;
}
#tree{
width:100%;
height:100%;
}
JavaScript
var chart = new OrgChart(document.getElementById("tree"), {
template: "ana",
enableSearch: false,
mouseScrool: OrgChart.action.none,
nodeMouseClick: OrgChart.action.none,
nodeBinding: {
"field_0": "id",
},
tags: {
"ig": {
// template: "invisibleGroup",
subTreeConfig: {
orientation: OrgChart.orientation.bottom
}
}
}
});
chart.load([
{id: "root", tags: ["ig"] },
{id: 0, stpid: "root"},
{id: 1, pid: 0 },
{id: 2, pid: 0},
{id: 3, pid: "root"},
{id: 4, pid: "root"}
]);