(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.