Skip to content
Snippets Groups Projects
Commit 28d125df authored by Tim Molter's avatar Tim Molter Committed by Niklas Polke
Browse files

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

parent 1aabc057
No related branches found
No related tags found
No related merge requests found
...@@ -277,6 +277,12 @@ public class Axis implements ChartPart { ...@@ -277,6 +277,12 @@ public class Axis implements ChartPart {
// get some real tick labels // get some real tick labels
AxisTickCalculator axisTickCalculator = axisTick.getAxisTickCalculator(workingSpace); AxisTickCalculator axisTickCalculator = axisTick.getAxisTickCalculator(workingSpace);
String sampleLabel = axisTickCalculator.getTickLabels().get(0); 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)); TextLayout textLayout = new TextLayout(sampleLabel, getChartPainter().getStyleManager().getAxisTickLabelsFont(), new FontRenderContext(null, true, false));
AffineTransform rot = AffineTransform rot =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment