Wrap or cut long labels in Pentaho CCC

776 views Asked by At

How to cut long labels of the Bar Chart Control’s base axis? I have already tried to cut them in the Extension Points (baseAxisLabel_text):

function(a){
    var str=this.scene.atoms.category.label;
    if (str.length>30){
        str=str.substring(0,30)+' ...';
    }
    return str;
}

However, it seems that Chart Control width is calculated taking into account old label length. Now I have white area at the left of my bars. enter image description here How to solve this?

1

There are 1 answers

0
Timur Kobilov On

I found the solution.

I just moved slightly changed function from Extension Points (baseAxisLabel_text) to baseAxisTickFormatter (Advanced Properties of the chart control)

function(v){
    if (v.length>30){
        v=str.substring(0,30)+' ...';
    }
    return v;
}