Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
tbcare
tbcare-web
Commits
0a0e81af
Commit
0a0e81af
authored
Jun 07, 2021
by
Nabilah Adani
Browse files
[CHORES] edit pie img width and height
parent
e0d21704
Pipeline
#82088
passed with stages
in 4 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/scenes/Home/utilities/utils.tsx
View file @
0a0e81af
...
...
@@ -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
,
1
4
0
,
{
align
:
"
center
"
})
doc
.
text
(
"
Total Keseluruhan :
"
+
total
+
"
Kasus
"
,
pageWidth
/
2
,
1
5
0
,
{
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
)
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment