# Revenue by region (Trellis example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/trellis/revenue-by-region/ · Index for agents: https://westcoast-charts.com/llms.txt

One area panel per region on a shared y scale, synced crosshair, latest value in each header.

- Chart type: `area` (Area)
- Collection: Trellis · Trellis
- Raw configuration: https://westcoast-charts.com/gallery-src/trellis/revenue-by-region.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/trellis/revenue-by-region.html

## Setup

```js
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)
```

## Options

```js
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()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export trellis-revenue-by-region.json --out trellis-revenue-by-region.svg --with-table` (save the options above as JSON first)
