Hiding labels on y axis in Chart.js
To hide just the labels, in version 2.3.0 of Charts.js, you disable ticks
like so:
options: {
scales: {
yAxes: [{
ticks: {
display: false
}
}]
}
}
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]
}]
}
});
This will hide labels in Y-Axis: (but not X-Axis)
scaleShowLabels: false,
options: {
scales: {
yAxes: [{
gridLines: {
display: true,
color: 'rgba(219,219,219,0.3)',
zeroLineColor: 'rgba(219,219,219,0.3)',
drawBorder: false, // <---
lineWidth: 27,
zeroLineWidth: 1
},
ticks: {
beginAtZero: true,
display: true
}
}]
}
}