MalcolmInTheCenter
MalcolmInTheCenter

Reputation: 1605

How do I remove the y-axis labels from a graph?

I'm working on a line graph using Chart.js, I need to create a graph like the image below.
My problem is how do I remove the y-axis labels and add a vertical one instead?

This is the code I have for the vertical y-axis text

var options = {
  scales: {
    yAxes: [{
      scaleLabel: {
        display: true,
        labelString: "Normalized/Indexed Data",

      }
    }]

  }
}

But how do I remove the other labels (1.0, 1.5, 2.0 ...) enter image description here

enter image description here

Upvotes: 1

Views: 1691

Answers (1)

Shawn
Shawn

Reputation: 2735

You can add ticks:{ display: false }. Docs

var options = {
  scales: {
    yAxes: [{
      scaleLabel: {
        display: true,
        labelString: "Normalized/Indexed Data",

      },
      ticks:{
        display: false
      }
    }]

  }
}

Upvotes: 3

Related Questions