Reputation: 2083
I'm using ChartJS in my React application to render Bar chart with vertical bars and I need to display the label at the bottom of each bar but hide the vertical lines that come in between bars (ticks). Here is what I tried so far:
This does the opposite from what I want, it shows the ticks but not the labels:
xAxes : [ {
display : true, // set this to false to hide the labels under the bars
ticks: {
display : false
}
}]
This shows everything:
xAxes : [ {
display : true, // set this to false to hide the labels under the bars
maxTicksLimit: 0
}]
Any suggestions?
Upvotes: 2
Views: 1426
Reputation: 1
For Chartjs 2.9.3, you can use:
xAxes: [{
gridLines: {
drawTicks: false,
}
}]
Upvotes: 0
Reputation: 450
How about setting the gridline display to false?
xAxes: [{
gridLines: {display:false}
}]
Upvotes: 1