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

557
Vistas
Legends in Chart Js don't appears

The legend is not shown in Chart JS, I have read documentation and others but nothing... Only the label in which you typed a phrase is displayed. I know it's something very simple but it's making me waste my time. my chart

Code:

type: 'bar',
                data: {
                    labels: [{% for elemento1 in mesesEvolucion %}'{{ elemento1 }}',{% endfor %} ],
                    datasets: [{
                            label: 'Evolucion de el último año',
                            data: [{% for elemento1 in elemento.datosGraficaEvolucion %}{{ elemento1.mesX }},{% endfor %} ],
                            backgroundColor: [
                                'rgba(255, 99, 132, 0.2)',
                                'rgba(54, 162, 235, 0.2)',
                                'rgba(255, 206, 86, 0.2)',
                                'rgba(75, 192, 192, 0.2)',
                                'rgba(153, 102, 255, 0.2)',
                                'rgba(255, 159, 64, 0.2)'
                            ],
                            borderColor: [
                                'rgba(255, 99, 132, 1)',
                                'rgba(54, 162, 235, 1)',
                                'rgba(255, 206, 86, 1)',
                                'rgba(75, 192, 192, 1)',
                                'rgba(153, 102, 255, 1)',
                                'rgba(255, 159, 64, 1)'
                            ],
                            borderWidth: 1
                        }]
                },
                options: {
                    scales: {
                        y: {
                            beginAtZero: true,
                            ticks: {color: 'white'}
                        },
                        x: {
                            beginAtZero: true,
                            ticks: {color: 'white'}
                        }
                    },
                    plugins: {
                        legend: {
                            display: true,
                            labels: {
                                color: 'rgb(255, 255, 255)'
                            }
                        },
                        title: {
                            display: true,
                            text: 'Evolución anual',
                            color: '#FFFFFF',
                            font: {
                                size: '14'
                            }
                        }
                    }
                }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this:

plugins: {
    legend: {
      position: "top",
      display: true,
        labels: {
          color: "#0d6dfdb0",
          font: {
            family: "IRANSansWeb" 
          }
        },
        tooltip: {
          bodyFont: {
            family: "IRANSansWeb" 
          },
          titleFont: {
            family: "IRANSansWeb" 
          }
        }

    },
    title: {
      display: true,
      text: "some title",
      color: "rgb(16, 97, 219)",
      font: {
        family: "IRANSansWeb",
      },
    },
  },
about 4 years ago · Juan Pablo Isaza Denunciar
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