Show / Hide Table of Contents

Import

BALKAN OrgChartJS supports importing from CSV, XML and JSON files:

CSV

 
    
let chart = new OrgChart(document.getElementById("tree"), {
    menu: {
        importCSV: { 
            text: "Import CSV",
            icon: OrgChart.icon.csv(24,24, '#7A7A7A'),
            onClick: function(){ chart.importCSV(); }
        }
    },
    nodes: [
        { id: 1 },
        { id: 2, pid: 1 } 
    ]
});    
    

XML

 
    
let chart = new OrgChart(document.getElementById("tree"), {
    menu: {
        importXML: { 
            text: "Import XML",
            icon: OrgChart.icon.xml(24,24, '#7A7A7A'),
            onClick: function(){ chart.importXML(); }
            }
    },
    nodes: [
        { id: 1 },
        { id: 2, pid: 1 } 
    ]
});    
    

JSON

 
        
  let chart = new OrgChart(document.getElementById("tree"), {
      menu: {
          importXML: { 
              text: "Import XML",
              icon: OrgChart.icon.xml(24,24, '#7A7A7A'),
              onClick: function(){ chart.importXML(); }
          },
      ...
      },

  });    
    

This is a demo for importing. (You could export, edit the file and then import it agian.)