# Annotation authoring (Interactivity example)

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

Click the chart to pin notes; remove the last one.

Why it matters: no ink/authoring tool in core; app-level: click adds a labelled point annotation, list is editable and undoable

- Chart type: `area` (Area)
- Collection: Interactivity · Interactivity
- Raw configuration: https://westcoast-charts.com/gallery-src/interactivity/annotation-authoring.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/interactivity/annotation-authoring.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: "area",
    events: {
      click: (e, ch, o) => { const i = o.dataPointIndex; if (i == null || i < 0) return; notes.push({ x: d[i][0], y: d[i][1], t: 'Note ' + ++n }); draw(ch) }
    },
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Signups",
      data: [
        [1767571200000, 51],
        [1767657600000, 48],
        [1767744000000, 46],
        [1767830400000, 46],
        [1767916800000, 47],
        [1768003200000, 46],
        [1768089600000, 49],
        [1768176000000, 49],
        [1768262400000, 47],
        [1768348800000, 50],
        [1768435200000, 49],
        [1768521600000, 49],
        [1768608000000, 51],
        [1768694400000, 49],
        [1768780800000, 50],
        [1768867200000, 50],
        [1768953600000, 48],
        [1769040000000, 46],
        [1769126400000, 44],
        [1769212800000, 45],
        [1769299200000, 46],
        [1769385600000, 46],
        [1769472000000, 45],
        [1769558400000, 44],
        [1769644800000, 45],
        [1769731200000, 43],
        [1769817600000, 43],
        [1769904000000, 41],
        [1769990400000, 42],
        [1770076800000, 44],
        [1770163200000, 47],
        [1770249600000, 45],
        [1770336000000, 44],
        [1770422400000, 46],
        [1770508800000, 47],
        [1770595200000, 46],
        [1770681600000, 44],
        [1770768000000, 45],
        [1770854400000, 47],
        [1770940800000, 49],
        [1771027200000, 47],
        [1771113600000, 46],
        [1771200000000, 46],
        [1771286400000, 45],
        [1771372800000, 44],
        [1771459200000, 43],
        [1771545600000, 42],
        [1771632000000, 40],
        [1771718400000, 39],
        [1771804800000, 41],
        [1771891200000, 42],
        [1771977600000, 44],
        [1772064000000, 45],
        [1772150400000, 44],
        [1772236800000, 44],
        [1772323200000, 44],
        [1772409600000, 43],
        [1772496000000, 45],
        [1772582400000, 43],
        [1772668800000, 44]
      ]
    }
  ],
  xaxis: {
    type: "datetime"
  },
  tooltip: {
    shared: true,
    intersect: false
  },
  title: {
    text: "Click to add a note"
  },
  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 interactivity-annotation-authoring.json --out interactivity-annotation-authoring.svg --with-table` (save the options above as JSON first)
