From 621553b3f736a88c388e5a5a6c882114c8bc8ff4 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 3 May 2014 19:11:07 +0200 Subject: 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. --- type/Base.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'type/Base.class.php') 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 { var $data_sources = array('value'); var $order; var $legend = array(); - var $colors + var $colors = array(); var $rrd_title; var $rrd_vertical; var $rrd_format = '%5.1lf%s'; @@ -175,8 +175,9 @@ class Type_Base { function rrd_graph($debug = false) { $this->collectd_flush(); - if (!$this->colors) - $this->rainbow_colors(); + $colors = $this->colors; + $this->rainbow_colors(); + $this->colors = array_merge($this->colors, $colors); $graphdata = $this->rrd_gen_graph(); -- cgit v1.1