Revenue by region
One area panel per region on a shared y scale, synced crosshair, latest value in each header.
Open the chart without page chrome ↗
const options = {
chart: {
height: "auto",
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "area",
toolbar: {
show: false
}
},
series: [
{
name: "Revenue",
region: "North",
data: [99, 104, 107, 98, 107, 101, 94, 86, 92, 88, 96, 103]
},
{
name: "Revenue",
region: "South",
data: [107, 113, 110, 106, 98, 104, 101, 97, 96, 95, 104, 105]
},
{
name: "Revenue",
region: "East",
data: [95, 103, 100, 98, 99, 108, 117, 120, 125, 119, 115, 120]
},
{
name: "Revenue",
region: "West",
data: [93, 100, 98, 91, 100, 100, 91, 84, 77, 79, 76, 78]
},
{
name: "Revenue",
region: "Central",
data: [100, 92, 91, 99, 96, 95, 92, 88, 90, 93, 99, 91]
}
],
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
stroke: {
width: 2
},
fill: {
opacity: 0.18
},
dataLabels: {
enabled: false
},
yaxis: {
labels: {
formatter: (v) => '€' + Math.round(v) + 'k'
}
},
trellis: {
by: "region",
columns: 3,
aspectRatio: 1.9,
tooltip: "sync",
legend: "none",
wcc: {
headerValue: "last"
}
},
title: {
text: "Monthly revenue by region"
},
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: "area",
toolbar: {
show: false
}
},
series: [
{
name: "Revenue",
region: "North",
data: [99, 104, 107, 98, 107, 101, 94, 86, 92, 88, 96, 103]
},
{
name: "Revenue",
region: "South",
data: [107, 113, 110, 106, 98, 104, 101, 97, 96, 95, 104, 105]
},
{
name: "Revenue",
region: "East",
data: [95, 103, 100, 98, 99, 108, 117, 120, 125, 119, 115, 120]
},
{
name: "Revenue",
region: "West",
data: [93, 100, 98, 91, 100, 100, 91, 84, 77, 79, 76, 78]
},
{
name: "Revenue",
region: "Central",
data: [100, 92, 91, 99, 96, 95, 92, 88, 90, 93, 99, 91]
}
],
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
stroke: {
width: 2
},
fill: {
opacity: 0.18
},
dataLabels: {
enabled: false
},
yaxis: {
labels: {
formatter: (v) => '€' + Math.round(v) + 'k'
}
},
trellis: {
by: "region",
columns: 3,
aspectRatio: 1.9,
tooltip: "sync",
legend: "none",
wcc: {
headerValue: "last"
}
},
title: {
text: "Monthly revenue by region"
},
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-revenue-by-region.json --out trellis-revenue-by-region.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/revenue-by-region/index.md …