summaryrefslogtreecommitdiff
path: root/src/lib/rrdFlot.js
diff options
context:
space:
mode:
authorFrank Wuerthwein <fkw@ucsd.edu>2009-02-20 03:45:40 +0000
committerFrank Wuerthwein <fkw@ucsd.edu>2009-02-20 03:45:40 +0000
commit352f0130b5d50591c8445ab100a8dabcd4de54f4 (patch)
tree732ae1b3003b08f235a37f4616cdef0c79d36e52 /src/lib/rrdFlot.js
parent77653989fd308e12a2991deb9b83ee92c79c1a8c (diff)
Use rrdRRA2FlotObj
Diffstat (limited to 'src/lib/rrdFlot.js')
-rw-r--r--src/lib/rrdFlot.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js
index 3db3a27..dbdd8cf 100644
--- a/src/lib/rrdFlot.js
+++ b/src/lib/rrdFlot.js
@@ -166,19 +166,15 @@ rrdFlot.prototype.drawFlotGraph = function() {
}
// then extract RRA data about those DSs
- var flot_data=[];
- for (var j=0; j<ds_idxs.length; j++) {
- var ds_idx=ds_idxs[j];
- flot_data.push(rrdDS2FlotSeries(this.rrd_file,ds_idx,rra_idx));
- }
+ var flot_obj=rrdRRA2FlotObj(this.rrd_file,rra_idx,ds_idxs);
// finally do the real plotting
- this.bindFlotGraph(flot_data);
+ this.bindFlotGraph(flot_obj);
};
// ======================================
// Bind the graphs to the HTML tags
-rrdFlot.prototype.bindFlotGraph = function(flot_data) {
+rrdFlot.prototype.bindFlotGraph = function(flot_obj) {
var rf_this=this; // use obj inside other functions
var graph_jq_id="#"+this.graph_id;
@@ -187,16 +183,18 @@ rrdFlot.prototype.bindFlotGraph = function(flot_data) {
var graph_options = {
legend: {show:true},
lines: {show:true},
- xaxis: { mode: "time" },
+ xaxis: { mode: "time", min:flot_obj.min, max:flot_obj.max },
selection: { mode: "x" },
};
var scale_options = {
legend: {show:false},
lines: {show:true},
- xaxis: { mode: "time" },
+ xaxis: { mode: "time", min:flot_obj.min, max:flot_obj.max },
selection: { mode: "x" },
};
+ var flot_data=flot_obj.data;
+
var graph_data=this.selection_range.trim_flot_data(flot_data);
//var scale_data=flot_data.clone();
var scale_data=flot_data;