# HG changeset patch # User Fadi Abbud # Date 1562834346 -7200 # Node ID 29b294e77a5ce90dca55a172dbb9abd59d210613 # Parent 2e7f191bba27ce727220249be9e302ad4acb4203 client: pdf-gen: set diagram scale on pdf and adjust default template value(waterlevels, hydrologicalconditions) diff -r 2e7f191bba27 -r 29b294e77a5c client/src/components/gauge/HydrologicalConditions.vue --- 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); }, diff -r 2e7f191bba27 -r 29b294e77a5c client/src/components/gauge/Waterlevel.vue --- 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); },