How to hide y axis line in ChartJs?
This disables the vertical Y axis line:
options: {
scales: {
yAxes: [{
gridLines: {
drawBorder: false,
},
}]
},
},
This can be combined with display
to disable the vertical gridLines:
xAxes: [{
gridLines: {
display: false,
},
}],
Here's a working example: http://codepen.io/anon/pen/xqGGaV
var myBubbleChart = new Chart(ctx,{
type: 'bubble',
data: data,
options: {
scales:
{
yAxes: [{
gridLines : {
display : false
}
}]
}
}
});
From version 3 upwards, you should use this options to hide axes completely:
Picture: chartjs-without-axes
scales: {
x: {
display: false,
},
y: {
display: false,
}
},
For Chartjs version 3.3.2 this works for me
var barChart = new Chart(ctx,{
type: 'bar',
data: data,
options: {
scales:
{
y: {
grid: {
drawBorder: false, // <-- this removes y-axis line
lineWidth: 0.5,
}
}
}
}
});