Fakultas Ilmu Komputer UI

Commit 696c54ee authored by Nabilah Adani's avatar Nabilah Adani
Browse files

Merge branch 'pbi-13-diagram-statistik-kasus' into 'staging'

tampilan pie di pdf

See merge request !57
parents 139b5630 ecc0c6c8
Pipeline #82122 passed with stages
in 9 minutes and 50 seconds
......@@ -121,6 +121,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
const imgHeight = 130;
const pageWidth = 297;
const pageHeight = 210;
const imgPieWidth = 212;
const imgPieHeight = 110;
const pageImgWidth = 38;
const pageImgHeight = 30;
const marginX = (pageWidth - imgWidth) / 2;
......@@ -138,7 +142,10 @@ const image2pdf = (imageType: string, type: string, key: string, dataType: stri
if (key === "Tanggal")
doc.text("DATA KASUS TBC DEPOK", pageWidth/2, 24, {align:"center"});
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) => {
......@@ -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"})
else
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
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
if (key === "Tanggal")
doc.addImage(png, imageType, marginX, 12, 252, 156, undefined, "SLOW");
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) => {
......
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