-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
Hello! I'm using Chart.js v2.1.4. Thank you for the great code :)
I have a bar chart that looks like this:
The x-axis labels are hard to read because there is just about no padding between them.
Here is the same chart produced by Chart.js v1.0.2:
The labels are easier to read because they are rotated more to give more padding.
Is the v2.1.4 behaviour expected? How can I have the labels rotated more so they are easier to read?
I tried adding 15° rotation to the labels like this:
var options = {
scales: {
xAxes: [{
afterCalculateTickRotation: function(scale) { scale.labelRotation += 15; };
}],
}
};
This worked but of course it always adds extra rotation so it looks silly on a chart with only a few bars where the labels don't need to be rotated at all.
Many thanks!