OrgChart icon indicating copy to clipboard operation
OrgChart copied to clipboard

rendering graph in bullet list format

Open TheGobbo opened this issue 1 year ago • 0 comments

The code snippet that I am trying to use looks like this

const test = {
  'name': 'Lao Lao',
  'title': 'general manager',
  'children': [
      { 'name': 'Bo Miao', 'title': 'department manager' },
      { 'name': 'Su Miao', 'title': 'department manager',
      'children': [
          { 'name': 'Tie Hua', 'title': 'senior engineer' },
          { 'name': 'Hei Hei', 'title': 'senior engineer',
          'children': [
              { 'name': 'Dan Dan', 'title': 'engineer' }
          ]
          },
          { 'name': 'Pang Pang', 'title': 'senior engineer' }
      ]
      },
      { 'name': 'Hong Miao', 'title': 'department manager' },
  ]
  };
  
  console.log(test, JSON.stringify(test));
  setTimeout(() => {
  this.orgChart = $(this.$refs.chartContainer).orgchart({
      data: test,
      nodeContent: 'title',
  });
  }, 1000);

But it currently outputs this structure in the div referenced by the $refs.chartContainer, can anyone help pls? I could't find anything in options to set/change this behavior.. using latest npm version

image

TheGobbo avatar Jul 10 '24 20:07 TheGobbo