# Advanced timeline (Timeline example)

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

Overlapping bars with data labels showing durations.

- Chart type: `rangeBar` (Range Bar)
- Collection: Timeline · Timeline / range bar
- Raw configuration: https://westcoast-charts.com/gallery-src/timeline/advanced.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/timeline/advanced.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
```

## Options

```js
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "rangeBar",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Maya",
      data: [
        {
          x: "Code review",
          y: [1792677600000, 1792688400000]
        },
        {
          x: "Pairing",
          y: [1792656000000, 1792663200000]
        },
        {
          x: "Planning",
          y: [1792656000000, 1792663200000]
        },
        {
          x: "On call",
          y: [1792670400000, 1792684800000]
        }
      ]
    },
    {
      name: "Jon",
      data: [
        {
          x: "Code review",
          y: [1792670400000, 1792681200000]
        },
        {
          x: "Pairing",
          y: [1792674000000, 1792688400000]
        },
        {
          x: "Planning",
          y: [1792659600000, 1792670400000]
        },
        {
          x: "On call",
          y: [1792677600000, 1792688400000]
        }
      ]
    },
    {
      name: "Ines",
      data: [
        {
          x: "Code review",
          y: [1792666800000, 1792670400000]
        },
        {
          x: "Pairing",
          y: [1792670400000, 1792674000000]
        },
        {
          x: "Planning",
          y: [1792663200000, 1792677600000]
        },
        {
          x: "On call",
          y: [1792670400000, 1792674000000]
        }
      ]
    }
  ],
  plotOptions: {
    bar: {
      horizontal: true,
      barHeight: "80%"
    }
  },
  dataLabels: {
    enabled: true,
    formatter: (v) => Math.round((v[1] - v[0]) / 36e5) + ' h'
  },
  xaxis: {
    type: "datetime",
    labels: {
      datetimeUTC: true
    }
  },
  fill: {
    opacity: 0.85
  },
  legend: {
    position: "top"
  },
  title: {
    text: "Who does what today"
  },
  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 timeline-advanced.json --out timeline-advanced.svg --with-table` (save the options above as JSON first)
