Hierarchical Organization Chart for Angular (4+)
The ng2-org-chart
component displays heirarchal Organizational Chart.
This is extended version of ng2-org-chart with images. Million Credits to ng2-org-chart
Table of Contents
Usage
npm i ng2-org-chart -S
index.html
Include default styles in your
app.module.ts
;;; ; @
app.component.html
:
app.component.ts
:
topEmployee: IEmployee = name: 'Janis Martin' designation: 'CEO' img: "./assets/data/img/b.JPG" subordinates: name: 'Matthew Wikes' designation: 'VP' img: "./assets/data/img/b.JPG" subordinates: name: 'Tina Landry' designation: 'Budget Analyst' subordinates: name: 'Patricia Lyons' designation: 'VP' img: "./assets/data/img/c.JPG" subordinates: name: 'Dylan Wilson' designation: 'Web Manager' img: "./assets/data/img/b.JPG" subordinates: name: 'Deb Curtis' designation: 'Art Director' img: "./assets/data/img/c.JPG" subordinates: name: 'Larry Phung' designation: 'VP' img: "./assets/data/img/a.JPG" subordinates: ;
Here is the rendered output:
Custom CSS
You can override default styles with your custom CSS. Make sure you include your custom CSS after including the default CSS so that your styles override the default styles.