Skip to content
Snippets Groups Projects
Commit 7111782a authored by Tim Molter's avatar Tim Molter
Browse files

when determining X-Axis height, consider all labels, not just the first one

parent 18cf1ca1
No related branches found
No related tags found
No related merge requests found
......@@ -277,6 +277,12 @@ public class Axis implements ChartPart {
// get some real tick labels
AxisTickCalculator axisTickCalculator = axisTick.getAxisTickCalculator(workingSpace);
String sampleLabel = axisTickCalculator.getTickLabels().get(0);
// find the longest String in all the labels
for (int i = 1; i < axisTickCalculator.getTickLabels().size(); i++) {
if (axisTickCalculator.getTickLabels().get(i).length() > sampleLabel.length()) {
sampleLabel = axisTickCalculator.getTickLabels().get(i);
}
}
TextLayout textLayout = new TextLayout(sampleLabel, getChartPainter().getStyleManager().getAxisTickLabelsFont(), new FontRenderContext(null, true, false));
AffineTransform rot =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment