-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpie-chart.php
More file actions
35 lines (31 loc) · 677 Bytes
/
pie-chart.php
File metadata and controls
35 lines (31 loc) · 677 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
<?php
use Maantje\Charts\Pie\PieChart;
use Maantje\Charts\Pie\Slice;
require '../vendor/autoload.php';
$chart = new PieChart(
size: 500,
slices: [
new Slice(
value: 14,
color: '#5B9BD5',
label: 'Toys',
explodeDistance: 50,
),
new Slice(
value: 43,
color: '#ED7D31',
label: 'Furniture',
),
new Slice(
value: 15,
color: '#A5A5A5',
label: 'Home',
),
new Slice(
value: 28,
color: '#FFC001',
label: 'Electronics',
),
],
);
echo $chart->render();