-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
42 lines (37 loc) · 821 Bytes
/
example.php
File metadata and controls
42 lines (37 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* User: chuano
* Date: 22/11/2016
* Time: 20:31
*/
require __DIR__ . '/vendor/autoload.php';
use chuano\FPDFCircleCharts;
$pdf = new FPDFCircleCharts();
$pdf->AddPage();
// Default color is green
$x = 10;
$y = 10;
$padding = 0;
$percentage = 35;
$circleWidth = 190;
$pdf->SetXY($x, $y);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Arial', 'B', 16);
$pdf->CircleChart($circleWidth, $padding, $percentage);
$x = 10;
$y = 200;
$color = array(255, 0, 0); // Red
$padding = 10;
$percentage = 65;
$circleWidth = 90;
$pdf->SetXY($x, $y);
$pdf->CircleChart($circleWidth, $padding, $percentage, $color);
$x = 110;
$y = 200;
$color = array(0, 0, 255); // Blue
$padding = 10;
$percentage = 75;
$circleWidth = 30;
$pdf->SetXY($x, $y);
$pdf->CircleChart($circleWidth, $padding, $percentage, $color);
$pdf->Output();