Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Chartjs Plugin Annotation does not work (it is registered)

Box annotation wont render even though the configuration is correct


chartjs version: 3.6.0

chartjs-plugin-annotation version: 1.0.2


The plugin is registered like this:

import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';
Chart.register(annotationPlugin);

And I'm using the plugin as a constant that I add to the graph configuration:

plugins = {
            autocolors: false,
            annotation: {
                annotations: {
                    box1: {
                        type: 'box',
                        yMin: 2,
                        yMax: 4,
                        backgroundColor: 'rgba(221, 29, 33, 0.3)',
                        borderColor: 'rgba(0,0,0,0)',
                    },
                    box2: {
                        type: 'box',
                        yMin: 0,
                        yMax: 2,
                        backgroundColor: 'rgba(251, 206, 7, 0.3)',
                        borderColor: 'rgba(0,0,0,0)',
                    },
                    box3: {
                        type: 'box',
                        yMin: -2,
                        yMax: 0,
                        backgroundColor: 'rgba(92, 171, 42, 0.3)',
                        borderColor: 'rgba(0,0,0,0)',
                    },
                    box4: {
                        type: 'box',
                        yMin: -4,
                        yMax: -2,
                        backgroundColor: 'rgba(166, 166, 166, 0.3)',
                        borderColor: 'rgba(0,0,0,0)',
                    },
                },
            },
        };

I'm rendering the graph as a base64 string so that I can turn it into a static image. The data is plotted but the boxes are not. It was working two weeks ago and now it isn't.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!