aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorPim van den Berg2014-05-03 19:06:10 +0200
committerPim van den Berg2014-05-03 19:30:13 +0200
commit75a1e8a552a1e0f4d0948489737c93827ca4a8b5 (patch)
treea508b3703af194edc621d797a060fffe8c31fc57 /type
parentrename ds_names and dsname to legend (diff)
downloadapt-panopticon_cgp-75a1e8a552a1e0f4d0948489737c93827ca4a8b5.zip
apt-panopticon_cgp-75a1e8a552a1e0f4d0948489737c93827ca4a8b5.tar.gz
apt-panopticon_cgp-75a1e8a552a1e0f4d0948489737c93827ca4a8b5.tar.bz2
apt-panopticon_cgp-75a1e8a552a1e0f4d0948489737c93827ca4a8b5.tar.xz
type/base: show tinstances not defined in $this->order in graph
Previously if $this->order was defined in a graph, only type instances that were defined in $this->order showed up in the graph. Now it merges $this->order and the type instances.
Diffstat (limited to 'type')
-rw-r--r--type/Base.class.php11
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;