Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

266
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda