aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorPim van den Berg2014-03-23 12:24:45 +0100
committerPim van den Berg2014-03-23 12:29:05 +0100
commitb85a1526bdafe7af5f4d7af17b5599da09efccbc (patch)
treeb6013e8cc56f83a389e4886ad03c69157d8e59a3 /type
parentplugin/aggregation: cpu: allow 4 digits (diff)
downloadapt-panopticon_cgp-b85a1526bdafe7af5f4d7af17b5599da09efccbc.zip
apt-panopticon_cgp-b85a1526bdafe7af5f4d7af17b5599da09efccbc.tar.gz
apt-panopticon_cgp-b85a1526bdafe7af5f4d7af17b5599da09efccbc.tar.bz2
apt-panopticon_cgp-b85a1526bdafe7af5f4d7af17b5599da09efccbc.tar.xz
add SVG graph support
Diffstat (limited to 'type')
-rw-r--r--type/Default.class.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index 909ac32..91f557f 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -196,6 +196,14 @@ class Type_Default {
196 print_r($graphdata); 196 print_r($graphdata);
197 print '</pre>'; 197 print '</pre>';
198 break; 198 break;
199 case 'svg':
200 # caching
201 if (is_numeric($this->cache) && $this->cache > 0)
202 header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds")));
203 header("content-type: image/svg+xml");
204 $graphdata = implode(' ', $graphdata);
205 echo `$graphdata`;
206 break;
199 case 'png': 207 case 'png':
200 default: 208 default:
201 # caching 209 # caching
@@ -209,9 +217,18 @@ class Type_Default {
209 } 217 }
210 218
211 function rrd_options() { 219 function rrd_options() {
212 if ($this->graph_type != 'canvas') { 220 switch ($this->graph_type) {
213 $rrdgraph[] = $this->rrdtool; 221 case 'png':
214 $rrdgraph[] = 'graph - -a PNG'; 222 case 'hybrid':
223 $rrdgraph[] = $this->rrdtool;
224 $rrdgraph[] = 'graph - -a PNG';
225 break;
226 case 'svg':
227 $rrdgraph[] = $this->rrdtool;
228 $rrdgraph[] = 'graph - -a SVG';
229 break;
230 default:
231 break;
215 } 232 }
216 if ($this->rrdtool_opts != '') 233 if ($this->rrdtool_opts != '')
217 $rrdgraph[] = $this->rrdtool_opts; 234 $rrdgraph[] = $this->rrdtool_opts;