Nicolas Modrzyk
Nicolas Modrzyk

Reputation: 14197

Overlapping Label in IcCube Reporting

I have a problem with overlapping labels in a bar charts.

enter image description here

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.

enter image description here

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: enter image description here

The labels are rotated but do not fit the widget. I tried updating the margins, without a positive result.

Upvotes: 2

Views: 65

Answers (1)

Ivan Kuchmenko
Ivan Kuchmenko

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

enter image description here

Result enter image description here

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

Related Questions