
The Annotator lets people draw on a chart: circle a spike, point an arrow at a dip, add a note. In 5.25 it’s rebuilt from scratch, with more tools, annotations that stay on the data, and annotations that screen readers can read.
Notes that stay on the data
An annotation is pinned to what’s under it. On an XY chart, an arrow pointing at March stays on March when you zoom or scroll. On a map it stays on its longitude and latitude, on a pie chart on its slice, on a hierarchy or flow chart on its node.
To pin a note to the screen instead, set pinTo: "screen".
More tools
Rectangle, ellipse, highlight, cover, line, arrow, curve, measure, polyline, freehand, text, callout, caption and icons. Each has its colours, line width and style, line ends, font, opacity and blur.
The toolbar takes the chart’s theme colours. It can be dragged anywhere over the chart or folded down to Done, and it never gets bigger than the chart.
Annotations screen readers can read
An annotation isn’t just paint on a picture. Each one is its own element that screen readers find and read after the chart, with its text and what it’s pinned to: “Callout: Needs improvement (Czechia)”.
Set your own text for any annotation with ariaLabel, or "" to keep a purely decorative one out of the way.
Saved with the chart
Annotations are plain objects in the annotations setting. Save them where you like and load them back, or let ChartSerializer save them with the rest of the chart. Image and PDF exports include them.
let annotator = am5plugins_exporting.Annotator.new(root, {});
annotator.events.on("closed", (ev) => {
if (!ev.cancelled) {
localStorage.setItem("annotations", JSON.stringify(annotator.get("annotations")));
}
});
Open it with annotator.open(), or add an “Annotate” item to the export menu.
Upgrading
The Annotator no longer uses marker.js 2, so it’s one dependency fewer. Code written for the old one keeps working. One change: ESC now saves, and Cancel is hidden; escapeAction and buttons bring the old behaviour back.
Also in 5.25
XLSX export no longer needs SheetJS: amCharts writes the files itself, about 149 KB smaller gzipped. To keep using SheetJS, set xlsxLib.
Get amCharts 5.25
- npm:
npm install @amcharts/amcharts5 - CDN:
https://cdn.amcharts.com/lib/5/index.js
All options: amcharts.com/download
Everything in 5.25: changelog