Organisation chart
People or teams from the top down; branches fold. Good for who works with whom.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'orgchart',
root: {
name: 'Youssef',
role: 'Director',
children: [
{ name: 'Sami', role: 'Sales', children: [{ name: 'Nour', role: 'Shops' }, { name: 'Adam', role: 'Web' }] },
{ name: 'Ines', role: 'Product', children: [{ name: 'Omar', role: 'Design' }, { name: 'Sara', role: 'Build' }] },
{ name: 'Karim', role: 'Finance' },
],
},
};
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type orgchart takes:
interface OrgChartSpec extends Base {
type: 'orgchart';
root: OrgNode;
}
interface OrgNode extends TreeNode {
role?: string;Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More