Fakultas Ilmu Komputer UI

Commit ecc0c6c8 authored by Nabilah Adani's avatar Nabilah Adani
Browse files

Merge branch 'nabh/diagram-statistik-kasus-fe' into 'pbi-13-diagram-statistik-kasus'

tampilan pie di pdf

See merge request !56
parents 2cdccbd0 0a0e81af
Pipeline #82089 passed with stages
in 10 minutes and 9 seconds
...@@ -121,6 +121,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri ...@@ -121,6 +121,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
const imgHeight = 130; const imgHeight = 130;
const pageWidth = 297; const pageWidth = 297;
const pageHeight = 210; const pageHeight = 210;
const imgPieWidth = 212;
const imgPieHeight = 110;
const pageImgWidth = 38;
const pageImgHeight = 30;
const marginX = (pageWidth - imgWidth) / 2; const marginX = (pageWidth - imgWidth) / 2;
...@@ -138,7 +142,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri ...@@ -138,7 +142,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
if (key === "Tanggal") if (key === "Tanggal")
doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 24, {align:"center"}); doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 24, {align:"center"});
else else
doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 18, {align:"center"}); if (chartType)
doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 18, {align:"center"});
else
doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 18, {align:"center"});
} }
const writeInfoCases = (doc: jsPDF) => { const writeInfoCases = (doc: jsPDF) => {
...@@ -204,7 +211,7 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri ...@@ -204,7 +211,7 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
doc.text("Total Keseluruhan : " + total + " Kasus" , pageWidth/2, 155, {align:"center"}) doc.text("Total Keseluruhan : " + total + " Kasus" , pageWidth/2, 155, {align:"center"})
else else
if (chartType) if (chartType)
doc.text("Total Keseluruhan : " + total + " Kasus", pageWidth/2, 140, {align:"center"}) doc.text("Total Keseluruhan : " + total + " Kasus", pageWidth/2, 150, {align:"center"})
else else
doc.text("Total Keseluruhan : " + total + " Kasus", pageWidth/2, 150, {align:"center"}) doc.text("Total Keseluruhan : " + total + " Kasus", pageWidth/2, 150, {align:"center"})
} }
...@@ -261,7 +268,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri ...@@ -261,7 +268,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
if (key === "Tanggal") if (key === "Tanggal")
doc.addImage(png, imageType, marginX, 12, 252, 156, undefined, "SLOW"); doc.addImage(png, imageType, marginX, 12, 252, 156, undefined, "SLOW");
else else
doc.addImage(png, imageType, marginX, 12, imgWidth, imgHeight, undefined, "SLOW"); if (chartType)
doc.addImage(png, imageType, pageImgWidth, pageImgHeight, imgPieWidth, imgPieHeight, undefined, "SLOW");
else
doc.addImage(png, imageType, marginX, 12, imgWidth, imgHeight, undefined, "SLOW");
} }
const blobToImage = (blob: Blob) => { const blobToImage = (blob: Blob) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment