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

281
Views
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 answers
Answer question

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 Report
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!