MCPcopy Index your code
hub / github.com/chartjs/chartjs-plugin-annotation

github.com/chartjs/chartjs-plugin-annotation @v3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.0 ↗ · + Follow
368 symbols 711 edges 281 files 4 documented · 1% 11 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

chartjs-plugin-annotation.js

GitHub Workflow Status Coverage Status release npm (latest) documentation Awesome

An annotation plugin for Chart.js >= 4.0.0


> This plugin needs to be registered. It does not function as inline plugin.

For Chart.js 3.7.0 to 3.9.1 support, use version 2.2.1 of this plugin

For Chart.js 3.0.0 to 3.6.2 support, use version 1.4.0 of this plugin

For Chart.js 2.4.0 to 2.9.x support, use version 0.5.7 of this plugin

This plugin draws lines, boxes, points, labels, polygons and ellipses on the chart area.

Annotations work with line, bar, scatter and bubble charts that use linear, logarithmic, time, or category scales. Furthermore you can use a doughnut label annotation which can be used to add contents (text, image, canvas) in the middle area of the doughnut charts.

Example Screenshot

View this example

Documentation

You can find documentation for chartjs-plugin-annotation at www.chartjs.org/chartjs-plugin-annotation.

Contributing

Before submitting an issue or a pull request to the project, please take a moment to look over the contributing guidelines first.

License

Chart.Annotation.js is available under the MIT license.

Extension points exported contracts — how you extend this code

LabelPositionObject (Interface)
(no doc)
types/label.d.ts
EventContext (Interface)
(no doc)
types/events.d.ts
AnnotationBoxModel (Interface)
(no doc)
types/element.d.ts
AnnotationTypeRegistry (Interface)
(no doc)
types/options.d.ts
PluginOptionsByType (Interface)
(no doc)
types/index.d.ts
LabelPadding (Interface)
(no doc)
types/label.d.ts
PartialEventContext (Interface)
(no doc)
types/events.d.ts
AnnotationElement (Interface)
(no doc)
types/element.d.ts

Core symbols most depended-on inside this repo

inRange
called by 49
src/types/box.js
rotated
called by 32
src/helpers/helpers.geometric.js
getCenterPoint
called by 31
src/types/box.js
retrieveScaleID
called by 11
src/helpers/helpers.chart.js
requireVersion
called by 10
src/helpers/helpers.core.js
resolve
called by 9
src/elements.js
setBorderStyle
called by 9
src/helpers/helpers.canvas.js
getSize
called by 8
src/helpers/helpers.options.js

Shape

Function 286
Method 36
Interface 32
Class 14

Languages

TypeScript100%

Modules by API surface

src/types/line.js36 symbols
src/annotation.js20 symbols
types/options.d.ts18 symbols
test/fixtures/line/labelsScriptableOptions.js17 symbols
src/helpers/helpers.options.js17 symbols
src/helpers/helpers.chart.js16 symbols
src/helpers/helpers.canvas.js16 symbols
src/elements.js13 symbols
test/fixtures/line/scriptableOptions.js12 symbols
src/types/doughnutLabel.js12 symbols
test/fixtures/point/scriptableOptions.js11 symbols
test/fixtures/ellipse/scriptableOptions.js10 symbols

For agents

$ claude mcp add chartjs-plugin-annotation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact