Advanced timeline

Overlapping bars with data labels showing durations.

Chart type
Range Bar rangeBar
Tier
Free Core
Collection
Timeline / range bar
Render
Live, site theme
View .md Agent setup
LIVE/timeline/advanced4 of 5 in Timeline

Configuration

Raw Standalone
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)
chart.render()