-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChartFactory.php
40 lines (28 loc) · 888 Bytes
/
ChartFactory.php
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
<?php
namespace Malwarebytes\AltamiraBundle;
use Altamira\Chart;
use Altamira\ChartIterator;
use Altamira\ChartRenderer;
class ChartFactory {
protected $library;
private $logger;
function __construct($library,$logger) {
$this->logger=$logger;
$this->setLibrary($library);
}
public function setLibrary($library) {
$this->logger->debug("Altamira library set to ".$library."!");
$this->library=$library;
if ($library == 'flot') {
ChartRenderer::pushRenderer( '\Altamira\ChartRenderer\DefaultRenderer' );
ChartRenderer::pushRenderer( '\Altamira\ChartRenderer\TitleRenderer' );
}
}
public function createChart($name) {
return new Chart($name,$this->library);
}
public function getChartIterator(array $charts) {
return new ChartIterator($charts);
}
}
?>