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

284
Vistas
How to change chart.js grid, and axis color?

I am using chart.js and jQuery, my chart look like this on light mode.

enter image description here

Lately, I added a .dark class to my body

body{
    background-color: white;
    color: black;

}

body.dark {
    background-color: black;
    color: white;
}

enter image description here

I can't see the x,y axis line or grid. How can I change the color of that to white ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In chart.js there is a configuration for cartesian axes, as per the docs . You can change the config like this to handle the colour of the X and Y axes.

const config = {
  type: 'bar',
  data,
  options: {
    scales: {
      x: {
        grid: {
          borderColor: 'white'
        }
      },
      y: {
        grid: {
          borderColor: 'white'
        }
      },
    }
  }
};
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