Reputation: 14197
I have a problem with overlapping labels in a bar charts.
The settings in the Axis label appear to be correct, because others settings do affect the rendering (bold, etc..) but spacing does not seem to be taken into account.
Any way to do a proper spacing of the labels, or actually to rotate them ?
Update1:
After applying the proposed settings this is what I get:
The labels are rotated but do not fit the widget. I tried updating the margins, without a positive result.
Upvotes: 2
Views: 65
Reputation: 96
There are no options in the widget fields but you can rotate these labels using the "On Widget Options" hook.
You can find it on "Hooks" tab.
"On Widget Options" hook use this function:
function(context, options, $box) {
for (var i = 0; i < options.categoryAxis.guides.length; i++) {
options.categoryAxis.guides[i].labelRotation = 30; // rotation angle
}
return options;
}
Available fields for Guides can be checked here
Custom code
UPDATE: You can change top margin using this code lines:
options.marginTop = 88; // Top margin
Just add it into "On Widget Options" hook:
function(context, options, $box) {
options.marginTop = 88; // Top margin
for (var i = 0; i < options.categoryAxis.guides.length; i++) {
options.categoryAxis.guides[i].labelRotation = 30;
}
return options;
}
Upvotes: 3