Skip to content

Horizontal Bar With Error Bars

Code

ts
export const config: ChartConfiguration<'barWithErrorBars'> = {
  type: 'barWithErrorBars',
  data: {
    labels: ['A', 'B'],
    datasets: [
      {
        data: [
          {
            x: 4,
            xMin: 1,
            xMax: 6,
          },
          {
            x: 2,
            xMin: 1,
            xMax: 4,
          },
        ],
      },
    ],
  },
  options: {
    indexAxis: 'y',
  },
};