diff options
-rw-r--r-- | type/Base.class.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/type/Base.class.php b/type/Base.class.php index 7c06e5d..9ceee4e 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
@@ -11,8 +11,8 @@ class Type_Base { | |||
11 | var $seconds; | 11 | var $seconds; |
12 | var $data_sources = array('value'); | 12 | var $data_sources = array('value'); |
13 | var $order; | 13 | var $order; |
14 | var $legend; | 14 | var $legend = array(); |
15 | var $colors; | 15 | var $colors |
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'; |
@@ -256,7 +256,7 @@ class Type_Base { | |||
256 | if (is_array($this->files) && count($this->files)>1) { | 256 | if (is_array($this->files) && count($this->files)>1) { |
257 | # and must it be ordered? | 257 | # and must it be ordered? |
258 | if (is_array($this->order)) { | 258 | if (is_array($this->order)) { |
259 | $this->tinstances = array_merge(array_intersect($this->order, $this->tinstances)); | 259 | $this->tinstances = array_merge(array_unique(array_merge(array_intersect($this->order, $this->tinstances), $this->tinstances))); |
260 | } | 260 | } |
261 | # use tinstances as sources | 261 | # use tinstances as sources |
262 | if(is_array($this->data_sources) && count($this->data_sources)>1) { | 262 | if(is_array($this->data_sources) && count($this->data_sources)>1) { |
@@ -286,9 +286,8 @@ class Type_Base { | |||
286 | } | 286 | } |
287 | 287 | ||
288 | function parse_legend($sources) { | 288 | function parse_legend($sources) { |
289 | # fill legend if not defined by plugin | 289 | # fill up legend by items that are not defined by plugin |
290 | if (!is_array($this->legend)) | 290 | $this->legend = array_merge(array_combine($sources, $sources), $this->legend); |
291 | $this->legend = array_combine($sources, $sources); | ||
292 | 291 | ||
293 | # detect length of longest legend | 292 | # detect length of longest legend |
294 | $max = 0; | 293 | $max = 0; |