From 3deff291c5713091bdb0346752796b47afc03879 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 18 May 2013 22:53:39 +0200 Subject: add config option for showing smooth (curved) graphs --- conf/config.php | 3 +++ type/Default.class.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/conf/config.php b/conf/config.php index c734b09..685589d 100644 --- a/conf/config.php +++ b/conf/config.php @@ -48,6 +48,9 @@ $CONFIG['graph_type'] = 'png'; # use the negative X-axis in I/O graphs $CONFIG['negative_io'] = false; +# create smooth graphs (rrdtool -E) +$CONFIG['graph_smooth'] = false; + # browser cache time for the graphs (in seconds) $CONFIG['cache'] = 90; diff --git a/type/Default.class.php b/type/Default.class.php index dfbf2da..42d5090 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -21,6 +21,7 @@ class Type_Default { var $heigth; var $graph_type; var $negative_io; + var $graph_smooth; var $files; var $tinstances; @@ -40,6 +41,7 @@ class Type_Default { if (empty($this->heigth)) $this->heigth = $config['heigth']; $this->graph_type = $config['graph_type']; $this->negative_io = $config['negative_io']; + $this->graph_smooth = $config['graph_smooth']; } function rainbow_colors() { @@ -211,6 +213,8 @@ class Type_Default { } if ($this->rrdtool_opts != '') $rrdgraph[] = $this->rrdtool_opts; + if ($this->graph_smooth) + $rrdgraph[] = '-E'; $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); $rrdgraph[] = '-l 0'; -- cgit v1.1