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

166
Views
Negative values ​on the y axis when all points have a value of 0

I have a chart where the values ​​can be 0 or 1, and in chartJs 2 or lower it works perfect, but I migrated to version 3.6 and now the -1 appears, even though I set BeginAtZero true, min 0 and max 1. I need to make the 0 at the beginning of the y axis (as in version 2), not in the middle (as in version 3.6) this is my code

var ctx = document.getElementById("test");
var myChart = new Chart(ctx, {
   type: 'line',
   data: {
      labels: ["ab", "cd", "ef", "gh", "ij"],
      datasets: [{ data: [0, 0, 0, 0, 0] }]
   },
   options: // SEE BELOW
});

this is the options for the previous version (works correctly)

scales: {
   yAxes: [{
       ticks: {
           beginAtZero: true,
           max: 1,
           min: 0
       }
   }]
}

and this is the code for version 3.6 (y axis is wrong)

scales: {
   y: {
      ticks: {
         beginAtZero: true,
         max: 1,
         min: 0
      }
  }
}
about 4 years ago · Juan Pablo Isaza
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!