yarn add chartjs-plugin-annotation
Then edit app/javascript/application.js
import "chartkick/chart.js"
# Add these lines
import annotationPlugin from 'chartjs-plugin-annotation';
Chartkick.adapters[0].library.register(annotationPlugin);
See this pull request for more details
You can then add annotations using the following example format:
<%= line_chart data, library: {plugins: {annotation: {annotations: {line1: {type: "line", yMin: 2, yMax: 2}}}}} %>