I'm trying to find a way of hiding the grid lines that extend beyond the max value of the axis (see image below for reference).
And the same for the X-Axis of course. I essentially just want the lines to stop at the max tick value. I've scoured the documentation but no avail so hoping the good people of SE will be able to suggest a solution.
What version are you using? My bar chart in v 2.5.0 doesn't extend above
It does have the optional 'padding' argument:
window.myBarChart = new Chart(ctx, {
type: 'bar',
data: barChartData,
options: {
elements: {
rectangle: {
borderWidth: 2,
}
},
layout: {
padding: {
top: 12
}
},
responsive: true,
legend: {
position: 'right',
}
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.