Org Chart With Metrics
Metrics on every card: head count rolled up through the hierarchy, budget and open roles as a fields row, budget used as a progress bar. The formatter computes them from the node and its subtree (fields / progress returned from node.formatter).
Open the chart without page chrome ↗Drawing width at least 1,000 px. Scroll within the chart on smaller screens.
const options = {
chart: {
height: 760,
toolbar: {
show: false
},
type: "tree"
},
series: [
{
data: [
{
id: "p26",
name: "Kira Lund",
title: "Chief Executive",
children: [
{
id: "p9",
name: "Maya Grieve",
title: "VP Engineering",
children: [
{
id: "p4",
name: "Yara Quist",
title: "Platform lead",
children: [
{
id: "p1",
name: "Ava Holm",
title: "Site reliability",
children: undefined,
value: 11,
budget: 1.1,
spent: 0.924,
open: 3,
head: 11
},
{
id: "p2",
name: "Zane Quist",
title: "Infrastructure",
children: undefined,
value: 14,
budget: 2.5,
spent: 1.475,
open: 1,
head: 14
},
{
id: "p3",
name: "Vik Thorne",
title: "Developer tools",
children: undefined,
value: 4,
budget: 2.2,
spent: 1.1880000000000002,
open: 0,
head: 4
}
],
budget: 5.800000000000001,
spent: 4.002000000000001,
open: 4,
head: 29
},
{
id: "p8",
name: "Elif Oakes",
title: "Product engineering",
children: [
{
id: "p5",
name: "Vik Grieve",
title: "Web",
children: undefined,
value: 6,
budget: 2.8,
spent: 2.324,
open: 3,
head: 6
},
{
id: "p6",
name: "Sana Faro",
title: "Mobile",
children: undefined,
value: 3,
budget: 1.8,
spent: 1.53,
open: 1,
head: 3
},
{
id: "p7",
name: "Ben Ivers",
title: "API",
children: undefined,
value: 8,
budget: 2.3,
spent: 1.081,
open: 2,
head: 8
}
],
budget: 6.8999999999999995,
spent: 3.2429999999999994,
open: 6,
head: 17
}
],
budget: 12.7,
spent: 7.111999999999999,
open: 10,
head: 46
},
{
id: "p15",
name: "Ben Oakes",
title: "VP Product",
children: [
{
id: "p12",
name: "Dev Castell",
title: "Design lead",
children: [
{
id: "p10",
name: "Sana Oakes",
title: "Research",
children: undefined,
value: 9,
budget: 2.9,
spent: 1.5079999999999998,
open: 2,
head: 9
},
{
id: "p11",
name: "Cleo Dorsey",
title: "Visual design",
children: undefined,
value: 5,
budget: 2,
spent: 1.76,
open: 0,
head: 5
}
],
budget: 4.9,
spent: 4.165000000000001,
open: 2,
head: 14
},
{
id: "p13",
name: "Rafa Marlow",
title: "PM, Billing",
children: undefined,
value: 14,
budget: 1.5,
spent: 1.125,
open: 2,
head: 14
},
{
id: "p14",
name: "Tomas Quist",
title: "PM, Growth",
children: undefined,
value: 7,
budget: 0.5,
spent: 0.285,
open: 2,
head: 7
}
],
budget: 6.9,
spent: 6.417000000000001,
open: 6,
head: 35
},
{
id: "p22",
name: "Pia Rook",
title: "VP Sales",
children: [
{
id: "p18",
name: "Elif Jarl",
title: "EMEA",
children: [
{
id: "p16",
name: "Iris Faro",
title: "Account exec.",
children: undefined,
value: 9,
budget: 0.5,
spent: 0.23,
open: 0,
head: 9
},
{
id: "p17",
name: "Tomas Sorel",
title: "Account exec.",
children: undefined,
value: 5,
budget: 2.4,
spent: 1.464,
open: 1,
head: 5
}
],
budget: 2.9,
spent: 1.972,
open: 1,
head: 14
},
{
id: "p20",
name: "Pia Thorne",
title: "Americas",
children: [
{
id: "p19",
name: "Yara Arden",
title: "Account exec.",
children: undefined,
value: 13,
budget: 1.3,
spent: 1.222,
open: 1,
head: 13
}
],
budget: 1.3,
spent: 0.7020000000000001,
open: 1,
head: 13
},
{
id: "p21",
name: "Dev Faro",
title: "APAC",
children: undefined,
value: 11,
budget: 2.3,
spent: 1.6789999999999998,
open: 2,
head: 11
}
],
budget: 6.5,
spent: 4.745,
open: 4,
head: 38
},
{
id: "p25",
name: "Elif Rook",
title: "CFO",
children: [
{
id: "p23",
name: "Rafa Thorne",
title: "Controller",
children: undefined,
value: 9,
budget: 2.3,
spent: 1.4029999999999998,
open: 1,
head: 9
},
{
id: "p24",
name: "Wren Faro",
title: "FP&A",
children: undefined,
value: 11,
budget: 1,
spent: 0.51,
open: 3,
head: 11
}
],
budget: 3.3,
spent: 1.65,
open: 4,
head: 20
}
],
budget: 29.400000000000002,
spent: 14.7,
open: 24,
head: 139
}
]
}
],
plotOptions: {
tree: {
collapse: {
initialDepth: 2
},
node: {
width: 220,
height: 56,
stackLeaves: true,
avatar: false,
formatter: (c, { node: d }) => ({
subtitle: d.title,
badge: d.head + ' people',
fields: [{ label: 'Budget', value: '€' + d.budget.toFixed(1) + 'M' }, { label: 'Open roles', value: String(d.open) }],
progress: (d.spent / d.budget) * 100,
})
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'
WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
const options = {
chart: {
height: 760,
toolbar: {
show: false
},
type: "tree"
},
series: [
{
data: [
{
id: "p26",
name: "Kira Lund",
title: "Chief Executive",
children: [
{
id: "p9",
name: "Maya Grieve",
title: "VP Engineering",
children: [
{
id: "p4",
name: "Yara Quist",
title: "Platform lead",
children: [
{
id: "p1",
name: "Ava Holm",
title: "Site reliability",
children: undefined,
value: 11,
budget: 1.1,
spent: 0.924,
open: 3,
head: 11
},
{
id: "p2",
name: "Zane Quist",
title: "Infrastructure",
children: undefined,
value: 14,
budget: 2.5,
spent: 1.475,
open: 1,
head: 14
},
{
id: "p3",
name: "Vik Thorne",
title: "Developer tools",
children: undefined,
value: 4,
budget: 2.2,
spent: 1.1880000000000002,
open: 0,
head: 4
}
],
budget: 5.800000000000001,
spent: 4.002000000000001,
open: 4,
head: 29
},
{
id: "p8",
name: "Elif Oakes",
title: "Product engineering",
children: [
{
id: "p5",
name: "Vik Grieve",
title: "Web",
children: undefined,
value: 6,
budget: 2.8,
spent: 2.324,
open: 3,
head: 6
},
{
id: "p6",
name: "Sana Faro",
title: "Mobile",
children: undefined,
value: 3,
budget: 1.8,
spent: 1.53,
open: 1,
head: 3
},
{
id: "p7",
name: "Ben Ivers",
title: "API",
children: undefined,
value: 8,
budget: 2.3,
spent: 1.081,
open: 2,
head: 8
}
],
budget: 6.8999999999999995,
spent: 3.2429999999999994,
open: 6,
head: 17
}
],
budget: 12.7,
spent: 7.111999999999999,
open: 10,
head: 46
},
{
id: "p15",
name: "Ben Oakes",
title: "VP Product",
children: [
{
id: "p12",
name: "Dev Castell",
title: "Design lead",
children: [
{
id: "p10",
name: "Sana Oakes",
title: "Research",
children: undefined,
value: 9,
budget: 2.9,
spent: 1.5079999999999998,
open: 2,
head: 9
},
{
id: "p11",
name: "Cleo Dorsey",
title: "Visual design",
children: undefined,
value: 5,
budget: 2,
spent: 1.76,
open: 0,
head: 5
}
],
budget: 4.9,
spent: 4.165000000000001,
open: 2,
head: 14
},
{
id: "p13",
name: "Rafa Marlow",
title: "PM, Billing",
children: undefined,
value: 14,
budget: 1.5,
spent: 1.125,
open: 2,
head: 14
},
{
id: "p14",
name: "Tomas Quist",
title: "PM, Growth",
children: undefined,
value: 7,
budget: 0.5,
spent: 0.285,
open: 2,
head: 7
}
],
budget: 6.9,
spent: 6.417000000000001,
open: 6,
head: 35
},
{
id: "p22",
name: "Pia Rook",
title: "VP Sales",
children: [
{
id: "p18",
name: "Elif Jarl",
title: "EMEA",
children: [
{
id: "p16",
name: "Iris Faro",
title: "Account exec.",
children: undefined,
value: 9,
budget: 0.5,
spent: 0.23,
open: 0,
head: 9
},
{
id: "p17",
name: "Tomas Sorel",
title: "Account exec.",
children: undefined,
value: 5,
budget: 2.4,
spent: 1.464,
open: 1,
head: 5
}
],
budget: 2.9,
spent: 1.972,
open: 1,
head: 14
},
{
id: "p20",
name: "Pia Thorne",
title: "Americas",
children: [
{
id: "p19",
name: "Yara Arden",
title: "Account exec.",
children: undefined,
value: 13,
budget: 1.3,
spent: 1.222,
open: 1,
head: 13
}
],
budget: 1.3,
spent: 0.7020000000000001,
open: 1,
head: 13
},
{
id: "p21",
name: "Dev Faro",
title: "APAC",
children: undefined,
value: 11,
budget: 2.3,
spent: 1.6789999999999998,
open: 2,
head: 11
}
],
budget: 6.5,
spent: 4.745,
open: 4,
head: 38
},
{
id: "p25",
name: "Elif Rook",
title: "CFO",
children: [
{
id: "p23",
name: "Rafa Thorne",
title: "Controller",
children: undefined,
value: 9,
budget: 2.3,
spent: 1.4029999999999998,
open: 1,
head: 9
},
{
id: "p24",
name: "Wren Faro",
title: "FP&A",
children: undefined,
value: 11,
budget: 1,
spent: 0.51,
open: 3,
head: 11
}
],
budget: 3.3,
spent: 1.65,
open: 4,
head: 20
}
],
budget: 29.400000000000002,
spent: 14.7,
open: 24,
head: 139
}
]
}
],
plotOptions: {
tree: {
collapse: {
initialDepth: 2
},
node: {
width: 220,
height: 56,
stackLeaves: true,
avatar: false,
formatter: (c, { node: d }) => ({
subtitle: d.title,
badge: d.head + ' people',
fields: [{ label: 'Budget', value: '€' + d.budget.toFixed(1) + 'M' }, { label: 'Open roles', value: String(d.open) }],
progress: (d.spent / d.budget) * 100,
})
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export tree-org-chart-with-metrics.json --out tree-org-chart-with-metrics.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/tree/org-chart-with-metrics/index.md … This example uses Premium modules. Compare licences · Embedding in a distributed product?