changeset 3910:29b294e77a5c

client: pdf-gen: set diagram scale on pdf and adjust default template value(waterlevels, hydrologicalconditions)
author Fadi Abbud <fadi.abbud@intevation.de>
date Thu, 11 Jul 2019 10:39:06 +0200
parents 2e7f191bba27
children e4e496ae7974
files client/src/components/gauge/HydrologicalConditions.vue client/src/components/gauge/Waterlevel.vue
diffstat 2 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/gauge/HydrologicalConditions.vue	Thu Jul 11 10:02:35 2019 +0200
+++ b/client/src/components/gauge/HydrologicalConditions.vue	Thu Jul 11 10:39:06 2019 +0200
@@ -134,13 +134,13 @@
             type: "diagram",
             position: "topleft",
             offset: { x: 15, y: 50 },
-            width: 290,
+            width: 240,
             height: 100
           },
           {
             type: "diagramlegend",
             position: "topleft",
-            offset: { x: 30, y: 150 },
+            offset: { x: 42, y: 172 },
             colot: "black"
           },
           {
@@ -266,8 +266,7 @@
       svg2pdf(svg, this.pdf.doc, {
         xOffset: x,
         yOffset: y,
-        // TODO depend on the size and aspect ration on paper
-        scale: 0.2
+        scale: 0.353
       });
       offScreen.removeChild(svg);
     },
--- a/client/src/components/gauge/Waterlevel.vue	Thu Jul 11 10:02:35 2019 +0200
+++ b/client/src/components/gauge/Waterlevel.vue	Thu Jul 11 10:39:06 2019 +0200
@@ -141,13 +141,13 @@
             type: "diagram",
             position: "topleft",
             offset: { x: 15, y: 50 },
-            width: 290,
+            width: 240,
             height: 100
           },
           {
             type: "diagramlegend",
             position: "topleft",
-            offset: { x: 30, y: 150 },
+            offset: { x: 42, y: 172 },
             color: "black"
           },
           {
@@ -316,8 +316,7 @@
       svg2pdf(svg, this.pdf.doc, {
         xOffset: x,
         yOffset: y,
-        // TODO depend on the size and aspect ration on paper
-        scale: this.templateData.properties.paperSize === "a3" ? 0.3 : 0.27
+        scale: 0.353
       });
       offScreen.removeChild(svg);
     },