diff options
author | Pim van den Berg | 2014-05-03 19:11:07 +0200 |
---|---|---|
committer | Pim van den Berg | 2014-05-03 19:30:32 +0200 |
commit | 621553b3f736a88c388e5a5a6c882114c8bc8ff4 (patch) | |
tree | 899f5efcc8ff73f6d32fbda110a272848035083a | |
parent | type/base: show tinstances not defined in $this->order in graph (diff) | |
download | apt-panopticon_cgp-621553b3f736a88c388e5a5a6c882114c8bc8ff4.zip apt-panopticon_cgp-621553b3f736a88c388e5a5a6c882114c8bc8ff4.tar.gz apt-panopticon_cgp-621553b3f736a88c388e5a5a6c882114c8bc8ff4.tar.bz2 apt-panopticon_cgp-621553b3f736a88c388e5a5a6c882114c8bc8ff4.tar.xz |
type/base: always use rainbow_colors and overwrite them afterwards
Since the previous commit [type/base: show tinstances not defined in
$this->order in graph] all type instances that are not defined in the
plugin, are colored black. This way you always have nice colors.
-rw-r--r-- | type/Base.class.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/type/Base.class.php b/type/Base.class.php index 9ceee4e..5de381e 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
@@ -12,7 +12,7 @@ class Type_Base { | |||
12 | var $data_sources = array('value'); | 12 | var $data_sources = array('value'); |
13 | var $order; | 13 | var $order; |
14 | var $legend = array(); | 14 | var $legend = array(); |
15 | var $colors | 15 | var $colors = array(); |
16 | var $rrd_title; | 16 | var $rrd_title; |
17 | var $rrd_vertical; | 17 | var $rrd_vertical; |
18 | var $rrd_format = '%5.1lf%s'; | 18 | var $rrd_format = '%5.1lf%s'; |
@@ -175,8 +175,9 @@ class Type_Base { | |||
175 | function rrd_graph($debug = false) { | 175 | function rrd_graph($debug = false) { |
176 | $this->collectd_flush(); | 176 | $this->collectd_flush(); |
177 | 177 | ||
178 | if (!$this->colors) | 178 | $colors = $this->colors; |
179 | $this->rainbow_colors(); | 179 | $this->rainbow_colors(); |
180 | $this->colors = array_merge($this->colors, $colors); | ||
180 | 181 | ||
181 | $graphdata = $this->rrd_gen_graph(); | 182 | $graphdata = $this->rrd_gen_graph(); |
182 | 183 | ||