Feature request.
When having multiple line charts stacked on top of each other, they can't line up if you have varying digits on the Y Axis.
It would be useful if you could set the width of the labels on the Y Axis.
Work around but not ideal
options: {
scales: {
yAxes: [{
afterFit: function(scaleInstance) {
scaleInstance.width = 100; // sets the width to 100px
}
}]
}
}
Duplicate of #4340
The workaround doesn't seem to work with v3. Is it possible that afterFit callback has been removed?
This prints the instance of the scale with v2.93 but nothing with v3.
scales: {
yAxes: [{
afterFit: instance => console.log(instance)
}]
}
@dbauszus-glx did you find a working solution for v3?
@lessless I have not. Any help is welcome.
@dbauszus-glx this is kind of hacky, but I was able to fix the left axis width by setting the maximum axis width to zero and the left padding for the chart layout to 100:
scales: {
yAxes: [{
afterSetDimensions: function(axes) {
axes.maxWidth = 0;
console.log(axes.width);
}
}]
}
layout: {
padding: {
left: 100
}
}
Most helpful comment
Work around but not ideal
options: { scales: { yAxes: [{ afterFit: function(scaleInstance) { scaleInstance.width = 100; // sets the width to 100px } }] } }