summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralisonjm <alisonjm>2011-04-26 22:20:57 +0000
committeralisonjm <alisonjm>2011-04-26 22:20:57 +0000
commitdd32a16d861c799e9d98495e4c2190ace1956ba0 (patch)
tree39ca4e08f27174192eba8b5c140fcc1981f817eb
parentfe2a5609538e4d2bdac36d57417e38cead413a9e (diff)
Added multi_rra option (appends the consolidation function to name of RRA in resolution drop down menu).
-rw-r--r--doc/lib/rrdFlot_js.html6
-rw-r--r--src/lib/rrdFlot.js22
2 files changed, 12 insertions, 16 deletions
diff --git a/doc/lib/rrdFlot_js.html b/doc/lib/rrdFlot_js.html
index 5214c7d..d3c2660 100644
--- a/doc/lib/rrdFlot_js.html
+++ b/doc/lib/rrdFlot_js.html
@@ -136,8 +136,10 @@ creates an interactive
//"Top","Bottom","TopRight","BottomRight","None".
num_cb_rows: 12 //How many rows of DS checkboxes per column.
multi_ds: false //"true" appends the name of the aggregation function to the
- //name of the DS element. Useful for when an element is displayed
- //more than once but under different aggregation functions.
+ //name of the DS element.
+ multi_rra: false //"true" appends the name of the RRA consolidation function (CF)
+ //(AVERAGE, MIN, MAX or LAST) to the name of the RRA. Useful for
+ //RRAs over the same interval with different CFs.
}
</PRE></P>
</TD>
diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js
index 3c5c3b6..d1dd8f2 100644
--- a/src/lib/rrdFlot.js
+++ b/src/lib/rrdFlot.js
@@ -46,15 +46,6 @@
* yaxis: 1 // can be 1 or 2
* stack: 'none' // other options are 'positive' and 'negative'
* }
-/* rrdflot_defeaults defaults (see Flot docs for details)
- * {
- * legend: "Top" //Starting location of legend. Options are:
- * //"Top","Bottom","TopRight","BottomRight","None".
- * num_cb_rows: 12 //How many rows of DS checkboxes per column.
- * multi_ds: false //"true" appends the name of the aggregation function to the
- * //name of the DS element. Useful for when an element is displayed
- * //more than once but under different aggregation functions.
- * }
*/
function rrdFlot(html_id, rrd_file, graph_options, ds_graph_options, rrdflot_defaults) {
@@ -187,7 +178,10 @@ rrdFlot.prototype.populateRes = function() {
var step=rra.getStep();
var rows=rra.getNrRows();
var period=step*rows;
- var rra_label=rfs_format_time(step)+" ("+rfs_format_time(period)+" total)";
+ if (this.rrdflot_defaults.multi_rra) {
+ var rra_label=rfs_format_time(step)+" ("+rfs_format_time(period)+" total)-"+rra.getCFName();
+ }
+ else {var rra_label=rfs_format_time(step)+" ("+rfs_format_time(period)+" total)";}
form_el.appendChild(new Option(rra_label,i));
}
};
@@ -202,13 +196,13 @@ rrdFlot.prototype.populateDScb = function() {
row_el.vAlign="top";
var cell_el=null; // will define later
- if (this.rrdflot_defaults.num_cb_rows==null) {
- this.rrdflot_defaults.num_cb_rows=12;
+ if (this.rrdflot_defaults.num_legend_rows==null) {
+ this.rrdflot_defaults.num_legend_rows=8;
}
// now populate with DS info
var nrDSs=this.rrd_file.getNrDSs();
for (var i=0; i<nrDSs; i++) {
- if ((i%this.rrdflot_defaults.num_cb_rows)==0) { // one column every x DSs
+ if ((i%this.rrdflot_defaults.num_legend_rows)==0) { // one column every x DSs
cell_el=row_el.insertCell(-1);
}
var ds=this.rrd_file.getDS(i);
@@ -216,7 +210,7 @@ rrdFlot.prototype.populateDScb = function() {
var name=ds.getName()+"-"+ds.getType();
var name2=ds.getName();
}
- else {var name=ds.getName(); var name2=ds.getName();}
+ else {var name=ds.getName();}
var title=name;
var checked=(i==0); // only first checked by default
if (this.ds_graph_options[name]!=null) {