Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

270
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda