# Bullet (Custom series example)

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

Actual bars against target ticks and qualitative ranges.

- Chart type: `bar` (Bar)
- Collection: Custom series · Custom series
- Raw configuration: https://westcoast-charts.com/gallery-src/custom-series/bullet.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/custom-series/bullet.html

## Setup

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

## Options

```js
const options = {
  chart: {
    height: 360,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "bar",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Actual",
      data: [
        {
          x: "Revenue",
          y: 91,
          goals: [
            {
              name: "Target",
              value: 74,
              strokeWidth: 3,
              strokeHeight: 16,
              strokeColor: "#0f172a"
            }
          ]
        },
        {
          x: "Profit",
          y: 72,
          goals: [
            {
              name: "Target",
              value: 80,
              strokeWidth: 3,
              strokeHeight: 16,
              strokeColor: "#0f172a"
            }
          ]
        },
        {
          x: "Avg. order",
          y: 73,
          goals: [
            {
              name: "Target",
              value: 83,
              strokeWidth: 3,
              strokeHeight: 16,
              strokeColor: "#0f172a"
            }
          ]
        },
        {
          x: "New customers",
          y: 88,
          goals: [
            {
              name: "Target",
              value: 70,
              strokeWidth: 3,
              strokeHeight: 16,
              strokeColor: "#0f172a"
            }
          ]
        },
        {
          x: "Satisfaction",
          y: 87,
          goals: [
            {
              name: "Target",
              value: 89,
              strokeWidth: 3,
              strokeHeight: 16,
              strokeColor: "#0f172a"
            }
          ]
        }
      ]
    }
  ],
  plotOptions: {
    bar: {
      horizontal: true,
      barHeight: "36%",
      borderRadius: 2
    }
  },
  annotations: {
    xaxis: [
      {
        x: 0,
        x2: 50,
        fillColor: "#94a3b8",
        opacity: 0.18
      },
      {
        x: 50,
        x2: 75,
        fillColor: "#94a3b8",
        opacity: 0.1
      }
    ]
  },
  xaxis: {
    max: 100,
    labels: {
      formatter: (v) => v + '%'
    }
  },
  legend: {
    show: true,
    customLegendItems: ["Actual", "Target"]
  },
  title: {
    text: "KPI attainment vs target"
  },
  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 custom-series-bullet.json --out custom-series-bullet.svg --with-table` (save the options above as JSON first)
