sencha Touch:how to shorten axis labels

836 Views Asked by At

Is there any way to shorten the axis labels in sencha touch chart. As my axis labels are very long.Is it possible to show axis labels in two rows.

Please help me regarding this,

2

There are 2 best solutions below

0
On BEST ANSWER

I tried with below code and it working fine for me.

label: {
        renderer: function(val) {
        if (val.length > 10) {
        return val.substring(0, 10) + "...";
        }
    }

}
2
On

I am not sure if it is possible to show the label in two rows, but you can format the label using following code:

label : {
    renderer : function(val) {
        return val;
    }
}

May be you want to truncate the label length to 3 characters, and have a legend to display the full forms of abbreviations.