-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChart.php
More file actions
executable file
·132 lines (121 loc) · 2.36 KB
/
Chart.php
File metadata and controls
executable file
·132 lines (121 loc) · 2.36 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/**
* Abstract chart class
*
* @package mSVG
* @author Yarek Tyshchenko
* @since 2011-07-12
**/
abstract class Chart
{
/**
* Array of dimensions
*
* @var Array
**/
protected $_dimensions;
/**
* Holds the Data to plot
*
* @var Array
**/
protected $_data;
/**
* Stores the view
*
* @var string
**/
protected $_viewFile;
/**
* Default view file
* @var string
*/
protected $_defaultViewFile;
/**
* Sets the Chart dimensions
*
* @return Void
* @author Yarek Tyshchenko
**/
public function setDimensions($width, $height)
{
$this->_dimensions = array(
'width' => $width,
'height' => $height,
);
}
/**
* Return width of the graph
*
* @return string
* @author Yarek Tyshchenko
**/
public function getWidth()
{
return $this->_dimensions['width'];
}
/**
* Return the height of the graph
*
* @return void
* @author Yarek Tyshchenko
**/
public function getHeight()
{
return $this->_dimensions['height'];
}
/**
* Sets the Data to plot
*
* @return Void
* @author Yarek Tyshchenko
**/
public function setData($data)
{
$this->_data = $data;
}
/**
* Returns the Data array
*
* @return Array
* @author Yarek Tyshchenko
**/
public function getData()
{
return $this->_data;
}
/**
* Sets the view file
*
* @return Void
* @author Yarek Tyshchenko
**/
public function setViewFile($viewFile)
{
$this->_viewFile = $viewFile;
}
/**
* Returns a default view file if one is not set
* @return string ViewFile
*/
public function getViewFile()
{
if (!$this->_viewFile) {
$this->_viewFile = 'View/'.$this->_defaultViewFile.'.psvg';
}
return $this->_viewFile;
}
/**
* Render the view file with local vars
*
* @return String
* @author Yarek Tyshchenko
**/
public function getView()
{
ob_start();
include $this->getViewFile();
$outout = ob_get_clean();
return $outout;
}
} // END abstract class Chart