dabeng / OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
MIT License
2.83k stars 768 forks source link

rendering graph in bullet list format #749

Open TheGobbo opened 2 weeks ago

TheGobbo commented 2 weeks ago

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

mm05112 commented 2 weeks ago

你的邮件我已收到,愿七色之夏的光辉永远守护你