How to hide the tick marks of the axis in react-chartjs-2

I want to display the axisY without labels, but this is not work

  scales:{
    yAxes:[{
      scaleLabel:{
        display: false
      }
    }],
  },
}```

Upvotes: 0

Views: 2044

Answers (3)

Bahroze Ali
Bahroze Ali

Reputation: 123

If you want to hide label, use following

scales:{
    yAxes:[{
       ticks:{
       display: false
      }
    }]
}

Same goes for xAxes

Upvotes: 0

Sain Pradeep
Sain Pradeep

Reputation: 3125

Try this Source

options: { scales: { yAxes: [{ ticks: { display: false } }] } }

Upvotes: 0

Narkhede Tushar
Narkhede Tushar

Reputation: 683

Check if the below code works?

scales:{
yAxes:[{
  scaleLabel:{
    display: false
  },
  ticks: {
    display:false // it should work
  }
 }],
},

Upvotes: 1

Related Questions