How to hide y axis line in ChartJs?
From version 3 upwards, you should use this options to hide axes completely:
Picture: chartjs-without-axes
scales: {
x: {
display: false,
},
y: {
display: false,
}
},
UPDATE:
If you want to hide only the lines (and keep ticks) , move display: false
config to "grid" parameter, like this:
scales: {
y: {
grid: {
display: false
}
}
}
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