-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoxplot.php
More file actions
56 lines (50 loc) · 1.18 KB
/
Boxplot.php
File metadata and controls
56 lines (50 loc) · 1.18 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
54
55
56
<?php
namespace Macocci7\PhpBoxplot;
use Macocci7\PhpBoxplot\Plotter;
use Macocci7\PhpBoxplot\Helpers\Config;
use Nette\Neon\Neon;
/**
* class for managing boxplot
* @author macocci7 <macocci7@yahoo.co.jp>
* @license MIT
*/
class Boxplot extends Plotter
{
use Traits\JudgeTrait;
/**
* constructor
*/
public function __construct()
{
parent::__construct();
$this->loadConf();
}
/**
* loads config.
*/
private function loadConf(): void
{
Config::load();
$props = [
'CANVAS_WIDTH_LIMIT_LOWER',
'CANVAS_HEIGHT_LIMIT_LOWER',
];
foreach ($props as $prop) {
$this->{$prop} = Config::get($prop);
}
}
/**
* set config from specified resource
* @param string|mixed[] $configResource
*/
public function config(string|array $configResource): self
{
foreach (Config::filter($configResource) as $key => $value) {
$this->{$key} = $value;
if (strcmp('dataSet', $key) === 0 && empty($this->legends)) {
$this->legends = array_keys($value);
}
}
return $this;
}
}