Annotation authoring
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
Open the chart without page chrome ↗
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)
chart.render()import WestCoastCharts from 'west-coast-charts'
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() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export interactivity-annotation-authoring.json --out interactivity-annotation-authoring.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/interactivity/annotation-authoring/index.md …