PDA

View Full Version : [FIXED] (Beta 1) CartesianAxis setTextLabelPadding Doesn't Work When \n Used in FF7.0



19 Dec 2011, 6:27 AM
Brendan,

The setTextLabelPadding method in the CartesianAxis class does not seem to work when a new line character is escaped in the axis labels (please see attached LabelPadding.jpg). Here is an example code snippet.

timeAxis.setLabelProvider(new LabelProvider<Date>() {
@Override
public String getLabel(Date item) {
// Works with setTextLabelPadding method
//return DATE_FORMAT.format(item) + " " + TIME_FORMAT.format(item);
// Does not work with setTextLabelPadding method
return DATE_FORMAT.format(item) + "\n" + TIME_FORMAT.format(item);
}
});
timeAxis.setTextLabelPadding(0);

When there is no new line character is escaped in the axis labels, then the axis labels are up close to the tick marks. When there is, the axis labels are about 10 pixels down from the tick marks.

To reproduce, please run the attached ColumnChart_LabelPadding.txt commenting and un-commenting the return statements shown in the above.

Thanks,
John Lewis

19 Dec 2011, 4:55 PM
Brendan,

This entire thread pertains to Firefox 7.0.

I will open another thread regarding IE 8, where the problem is different.

John Lewis

BrendanC
21 Dec 2011, 3:24 PM
Thanks for the test case. I plan to improve axis label alignment in upcoming beta releases.

BrendanC
18 Jan 2012, 5:06 PM
Firefox tspan spacing will be vastly improved in the next release.