Hybrid View
-
17 May 2012 1:13 PM #1
(GXT 3.0.0 GA) Can’t Center TimeAxis Labels on Tick Marks in Charts
(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.
Browser versions
Firefox 7
Internet Explorer 8
Operating System
Windows 7 64 bit
Hardware
Dell Precision M4500
8 CPUs – Intel Core i7
8 GB Memory
Virtual Machine
No
Description
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.
Run Mode
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,
John L
-
21 May 2012 5:57 PM #2
Thanks for the report. I'll let you know when it is fixed.
-
22 May 2012 5:12 PM #3
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
-
23 May 2012 10:45 AM #4
Brendan,
Thanks for fixing this.
John L.
-
15 Aug 2012 1:33 PM #5
GXT 3.0.1 has been released and contains this fix.
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote