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

532
Views
Hiding labels on y axis in Chart.js

I need to hide labels in line chart drawn using library chart.js. I googled but no luck. Could that be hidden?

Thanks

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

To hide just the labels, in version 2.3.0 of Charts.js, you disable ticks like so:

options: {
    scales: {
        yAxes: [{
            ticks: {
                display: false
            }
        }]
    }
}
over 4 years ago · Santiago Trujillo Report

0

For version 2, you can do this with the Scales option in the global configuration.

  var ctx = document.getElementById("log");
  var chart = new Chart(ctx, {
      type: 'line',
      options: {
        scales: {
          xAxes: [{
            display: false
          }],
          yAxes: [{
            display: false
          }],
        }
      },
      data: {
        labels: ['Item 1', 'Item 2', 'Item 3'],
        datasets: [{
            fill: false,
            borderWidth: 1,
            data: [10, 20, 30]
        }]
      }
    });
over 4 years ago · Santiago Trujillo Report

0

This will hide labels in Y-Axis: (but not X-Axis)

    scaleShowLabels: false,
over 4 years ago · Santiago Trujillo 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!