diff options
Diffstat (limited to 'type')
-rw-r--r-- | type/Default.class.php | 23 |
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; |