Getting Started

There are two types of licenses: Community and Commercial.
If you plan to use a Commercial license, download the FREE Trial edition. If you want to use the product for free with limited functionality, start with the Community Edition.
Installation and usage
Add this script in your HTML file
<script src="https://cdn.balkan.app/orgchart.js"></script><script src="https://cdn.balkan.app/orgchart-community.js"></script>HTML
<div id="tree"></div>JavaScript
const chart = new OrgChart(document.getElementById("tree"), {
nodeBinding: {
field_0: "name",
}
});
chart.load([
{ id: 1, name: "Amber McKenzie" },
{ id: 2, pid: 1, name: "Ava Field" },
{ id: 3, pid: 1, name: "Peter Stevens" }
]);Result
Where:
- nodes is the data source.
- The id property is mandatory.
- pid — the parent ID; represents the connection between two nodes.
- nodeBinding — the
nameproperty from the data source is bound to thefield_0UI element from the template.
See all available options here.
Update the database
Use onAddNode and onRemoveNode methods to add or remove nodes in the database.
Use onUpdateNode to save changes in the database.
Here is an example showing how to update the database.
For more details, see our Server Side Implementation doc page.