PDA

View Full Version : Chart Category: Labels not centered after rotation



Swissbite
22 Aug 2012, 12:24 AM
Hi everybody

I've a problem and I don't know what I'm doing wrong or if it is really a bug in ExtJS >= 4.0 (Currently I'm using 4.1.1, but the error also occurred in 4.0.7).

I didn't find any thread or external page about this problem. If you did, please response with that link. ;)

The field in the store is a Date, so I reformat it to a readable String and rotate it. In the attached picture you will see that the text is not under the dash. What am I doing wrong or what are the points where I can look for some wrong category definitions? I'm using the standard ExtJS CSS.

This problem occurs on IE8,9, FF and Chrome. So it's not a browser bug.

Category definition:

{ type : 'Category',
position: 'bottom',
title : 'Datum',
fields : ['date'],
label : {
rotation:{degrees:-90},
renderer: function(v){
var rendered = Ext.String.trim(Ext.Date.format(v,'d.m.y'));
rendered = rendered.replace(/(\r\n|\n|\r)/gm,"").replace(/\s+/g," ");
if (scope.logValidAndEnabled===true) {
console.log('Rendering date axis :',v,this, rendered);
}
return rendered;
}
}
}

Swissbite
30 Aug 2012, 3:59 AM
Does nobody have an idea or a hint?

gameboy87
30 Aug 2012, 5:07 AM
May be the axis must be set to "time"..Please try that & let me know about it.

Swissbite
30 Aug 2012, 5:46 AM
Allready testet. And the category axis uses the render function, so it should just be equal to text.

Richie1985
4 Mar 2013, 11:09 AM
is there something new? i have the same problem.

gameboy87
4 Mar 2013, 11:23 PM
Change the degree to 270.


Allready testet. And the category axis uses the render function, so it should just be equal to text.

wilsjd
21 Mar 2013, 7:33 AM
None of the solutions suggested here have worked for me. Any idea if there is a workaround or a fix for this?

wilsjd
21 Mar 2013, 3:42 PM
Change rotation to rotate?.