Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
a recent build.
Ext GWT Premium Member
(GXT 3.0.0 GA) Canít Center TimeAxis Labels on Tick Marks in Charts
Version of Ext GWT
This problem occurs in the recently released GA version of Ext GWT 3.0.0.
Internet Explorer 8
Windows 7 64 bit
Dell Precision M4500
8 CPUs Ė Intel Core i7
8 GB Memory
We have a requirement to center the TimeAxis labels on the major tick marks when the TimeAxis is used horizontally below the chart (setPosition(Position.BOTTOM)).
However, there does not seem to be a way to do this.
Setting text anchor to middle does not work consistently. The labels tend to be aligned left of center.
Setting text anchor to start causes the labels to be aligned right of center.
Setting text anchor to end causes the labels to be aligned far right of center.
Occurs in when deployed to Tomcat (web mode), and running under Eclipse (dev mode).
Steps to Reproduce
The attached file (ColumnChartTimeAxisLabelsIssue.txt) can be used to demonstrate the problem. It is using TextAnchor.Middle.
The chart first comes up showing a range of time from December 1, 2012 through December 15, 2013.
At this point about all of the labels are aligned correctly (middle) except the first label (12/1). Pease see attached AnchorMiddleFF1.png (Firefox).
But, the alignment problem gets much worse as things change.
If the browser is resized horizontally, then all of the labels are aligned too far left of center. Pease see attached AnchorMiddleFF2.png (Firefox).
If the date range is increased using the Start Date and End Date fields, all of the labels are aligned too far left of center. Pease see attached AnchorMiddleFF3.png (Firefox).
Same problem with IE. Please see AnchorMiddleIE.png (Internet Explorer).
By changing the text alignment to start or end in the attached file (ColumnChartTimeAxisLabelsIssue.txt), you will see that those options do not help remedy the problem.
Please let me know if I am doing anything wrong in the code in the attached file or if there is a work around.
Thanks for the report. I'll let you know when it is fixed.
I have added support on cartesian axis for the TextAnchor attribute on horizontal labels and the TextBaseline attribute on vertical labels. This appears much more accurate for centering. TextAnchor.jpg
Ext GWT Premium Member
Thanks for fixing this.
GXT 3.0.1 has been released and contains this fix.