From 41bd43cd9f697919cf40f5db7ded658dba2f593c Mon Sep 17 00:00:00 2001 From: Matthias Betz Date: Thu, 12 Nov 2020 13:02:50 +0100 Subject: [PATCH] fixed number position in bar chart in pdf report --- .../hft/stuttgart/citydoctor2/reporting/pdf/PdfUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfUtils.java b/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfUtils.java index 790bcc01..c78f67f4 100644 --- a/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfUtils.java +++ b/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfUtils.java @@ -80,10 +80,12 @@ public class PdfUtils { val2Rect.setAttribute("height", "30"); Element val2Text = new Element("text", svgNs); svgElement.addContent(val2Text); - val2Text.setAttribute("x", "" + (WIDTH - 30)); + String val2String = "" + val2; + val2Text.setAttribute("x", "" + (WIDTH - val2String.length() * 10)); val2Text.setAttribute("y", "20"); val2Text.setAttribute("font-size", "18pt"); - val2Text.addContent("" + val2); + + val2Text.addContent(val2String); } return svgElement; -- GitLab