I'd like to know if there's an alternative to 1.0's { scaleShowVerticalLines: false }.
I need to hide the vertical grid lines but not the labels. I've tried scales.xAxes.display: false with no success.
@lucasengel you're close, the following will do it:
var chartInstance = new Chart(ctx, {
options: {
scales: {
xAxes: [{
gridLines: {
drawOnChartArea: false
}
}]
}
}
});
Some additional details are in the Grid Lines section in http://www.chartjs.org/docs/#scales-common-configuration
It worked! Thanks for the really fast answer, @etimberg.
You should use gridLines.display now instead of gridLines.drawOnChartArea
var chartInstance = new Chart(ctx, {
options: {
scales: {
xAxes: [{
gridLines: {
display: false
}
}],
yAxes: [{
gridLines: {
display: true
}
}]
}
}
});
Mine is not working.
What version of chart.js are you using? @gmimaster1945
You can refer to their documentation for more insight https://www.chartjs.org/docs/latest/axes/
Thanks for replying.
following version i have Chart.js v2.8.0
I just got the update now its working.
Thank you all.
Thanks for keepin this up-to-date, @tunjioye! I have to come back to Charts.js!
You are welcome @lucasengel
Chart.js is wonderful
Most helpful comment
@lucasengel you're close, the following will do it:
Some additional details are in the Grid Lines section in http://www.chartjs.org/docs/#scales-common-configuration