Department by quarter
Tidy rows (department, quarter, spend) become one column panel per department.
Open the chart without page chrome ↗
const options = {
chart: {
height: "auto",
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
toolbar: {
show: false
}
},
series: [],
plotOptions: {
bar: {
borderRadius: 2,
columnWidth: "55%"
}
},
dataLabels: {
enabled: false
},
trellis: {
data: [
{
dept: "Platform",
q: "Q1",
spend: 37
},
{
dept: "Platform",
q: "Q2",
spend: 54
},
{
dept: "Platform",
q: "Q3",
spend: 62
},
{
dept: "Platform",
q: "Q4",
spend: 77
},
{
dept: "Payments",
q: "Q1",
spend: 67
},
{
dept: "Payments",
q: "Q2",
spend: 46
},
{
dept: "Payments",
q: "Q3",
spend: 70
},
{
dept: "Payments",
q: "Q4",
spend: 42
},
{
dept: "Search",
q: "Q1",
spend: 80
},
{
dept: "Search",
q: "Q2",
spend: 71
},
{
dept: "Search",
q: "Q3",
spend: 22
},
{
dept: "Search",
q: "Q4",
spend: 62
},
{
dept: "Mobile",
q: "Q1",
spend: 80
},
{
dept: "Mobile",
q: "Q2",
spend: 59
},
{
dept: "Mobile",
q: "Q3",
spend: 63
},
{
dept: "Mobile",
q: "Q4",
spend: 27
},
{
dept: "Data",
q: "Q1",
spend: 88
},
{
dept: "Data",
q: "Q2",
spend: 90
},
{
dept: "Data",
q: "Q3",
spend: 70
},
{
dept: "Data",
q: "Q4",
spend: 71
},
{
dept: "Growth",
q: "Q1",
spend: 49
},
{
dept: "Growth",
q: "Q2",
spend: 34
},
{
dept: "Growth",
q: "Q3",
spend: 67
},
{
dept: "Growth",
q: "Q4",
spend: 36
}
],
by: "dept",
x: "q",
y: "spend",
columns: 3,
aspectRatio: 1.8,
legend: "none"
},
title: {
text: "Spend per quarter (k€)"
},
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 trellis from 'west-coast-charts/features/trellis'
WestCoastCharts.use(types).use(trellis)
const options = {
chart: {
height: "auto",
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "bar",
toolbar: {
show: false
}
},
series: [],
plotOptions: {
bar: {
borderRadius: 2,
columnWidth: "55%"
}
},
dataLabels: {
enabled: false
},
trellis: {
data: [
{
dept: "Platform",
q: "Q1",
spend: 37
},
{
dept: "Platform",
q: "Q2",
spend: 54
},
{
dept: "Platform",
q: "Q3",
spend: 62
},
{
dept: "Platform",
q: "Q4",
spend: 77
},
{
dept: "Payments",
q: "Q1",
spend: 67
},
{
dept: "Payments",
q: "Q2",
spend: 46
},
{
dept: "Payments",
q: "Q3",
spend: 70
},
{
dept: "Payments",
q: "Q4",
spend: 42
},
{
dept: "Search",
q: "Q1",
spend: 80
},
{
dept: "Search",
q: "Q2",
spend: 71
},
{
dept: "Search",
q: "Q3",
spend: 22
},
{
dept: "Search",
q: "Q4",
spend: 62
},
{
dept: "Mobile",
q: "Q1",
spend: 80
},
{
dept: "Mobile",
q: "Q2",
spend: 59
},
{
dept: "Mobile",
q: "Q3",
spend: 63
},
{
dept: "Mobile",
q: "Q4",
spend: 27
},
{
dept: "Data",
q: "Q1",
spend: 88
},
{
dept: "Data",
q: "Q2",
spend: 90
},
{
dept: "Data",
q: "Q3",
spend: 70
},
{
dept: "Data",
q: "Q4",
spend: 71
},
{
dept: "Growth",
q: "Q1",
spend: 49
},
{
dept: "Growth",
q: "Q2",
spend: 34
},
{
dept: "Growth",
q: "Q3",
spend: 67
},
{
dept: "Growth",
q: "Q4",
spend: 36
}
],
by: "dept",
x: "q",
y: "spend",
columns: 3,
aspectRatio: 1.8,
legend: "none"
},
title: {
text: "Spend per quarter (k€)"
},
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 trellis-department-by-quarter.json --out trellis-department-by-quarter.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/trellis/department-by-quarter/index.md …