-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangePropsByArray.php
More file actions
53 lines (49 loc) · 1.51 KB
/
ChangePropsByArray.php
File metadata and controls
53 lines (49 loc) · 1.51 KB
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
43
44
45
46
47
48
49
50
51
52
53
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Macocci7\PhpHistogram\Histogram;
$props = [
'canvasWidth' => 600,
'canvasHeight' => 400,
'canvasBackgroundColor' => '#224499',
'plotarea' => [
'offset' => [90, 80],
'width' => 420,
'height' => 240,
'backgroundColor' => null,
],
'frameXRatio' => 0.5,
'frameYRatio' => 0.4,
'axisColor' => '#999',
'axisWidth' => 3,
'gridColor' => '#eee',
'gridWidth' => 1,
'gridHeightPitch' => 1,
'barBackgroundColor' => '#ffcc66',
'barBorderColor' => '#ff6600',
'barBorderWidth' => 2,
'frequencyPolygonColor' => '#33cc00',
'frequencyPolygonWidth' => 3,
'cumulativeRelativeFrequencyPolygonColor' => '#ff5577',
'cumulativeRelativeFrequencyPolygonWidth' => 7,
'fontPath' => '/usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf',
'fontSize' => 24,
'fontColor' => '#eeeeee',
'showBar' => true,
'showFrequencyPolygon' => true,
'showCumulativeRelativeFrequencyPolygon' => true,
'showFrequency' => true,
'labelX' => 'Items Purchased',
'labelXOffsetX' => 0,
'labelXOffsetY' => 0,
'labelY' => 'Number of Customers',
'labelYOffsetX' => 0,
'labelYOffsetY' => 0,
'caption' => 'Items Purchased / month (Mar 2026)',
'captionOffsetX' => 0,
'captionOffsetY' => 0,
];
$hg = new Histogram();
$hg->setClassRange(5)
->setData([1, 5, 6, 10, 12, 14, 15, 16, 17, 18, 20, 24, 25])
->config($props)
->create(__DIR__ . '/img/ChangePropsByArray.png');