Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 890
Supriya Kale Avatar asked Feb 25 '15 10:02

Supriya Kale


People also ask

How do you hide Y axis labels in Chartjs?

To also hide the tick marks themselves, add gridLines: { tickMarkLength: 0 } to the y axis definition (tested in version 2.9. 4).

How do I hide the Y axis in a bar chart?

To hide one or more axes, hover over Axes to display a right arrow. Select the arrow to display a list of axes that can be displayed or hidden on the chart. Clear the check box for the axes you want to hide. Select the check boxes for the axes you want to display.


Video Answer


1 Answers

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

options: {     scales: {         yAxes: [{             ticks: {                 display: false             }         }]     } } 
like image 134
Gene Parcellano Avatar answered Sep 23 '22 20:09

Gene Parcellano