I want to align the y-axis tick labels above the ticks in chartJS.
Here's what I've got so far:
I want the tick labels 0M
, 20M
, and 40M
above the tick labels. Something like this:
Here's my chart config:
new Chart(ctx, {
type: 'bar',
data,
options: {
...
scales: {
xAxes: [{ ... }],
yAxes: [{
stacked: true,
position: 'right',
gridLines: {
drawBorder: false
},
ticks: {
maxTicksLimit: 3
}
}]
}
}
})
I'm not able to find any option in the chart options to do such a thing. Please help
getPixelForTick
method – Rhea