diff options
author | Frank Wuerthwein <fkw@ucsd.edu> | 2009-02-16 13:11:45 +0000 |
---|---|---|
committer | Frank Wuerthwein <fkw@ucsd.edu> | 2009-02-16 13:11:45 +0000 |
commit | 55cca35ef38c4972a1c99ba8f3a490f9c070a3b5 (patch) | |
tree | 4cfc7fc996194737738c5b13d03ab15d3302e4e5 /src/lib/rrdFlot.js | |
parent | bfbfbfc49140e88753823e01abdc1ffc12e44ba2 (diff) |
Add few more helper methods to rrdFlotSelection
Diffstat (limited to 'src/lib/rrdFlot.js')
-rw-r--r-- | src/lib/rrdFlot.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js index 146f816..3db3a27 100644 --- a/src/lib/rrdFlot.js +++ b/src/lib/rrdFlot.js @@ -200,20 +200,18 @@ rrdFlot.prototype.bindFlotGraph = function(flot_data) { var graph_data=this.selection_range.trim_flot_data(flot_data);
//var scale_data=flot_data.clone();
var scale_data=flot_data;
-
var graph = $.plot($(graph_jq_id), graph_data, graph_options);
var scale = $.plot($(scale_jq_id), scale_data, scale_options);
- if (this.selection_min!=null) {
- scale.setSelection({ xaxis: {from: this.selection_min, to: this.selection_max}},true); //don't fire event, no need
+ if (this.selection_range.isSet()) {
+ scale.setSelection(this.selection_range.getFlotRanges(),true); //don't fire event, no need
}
// now connect the two
$(graph_jq_id).bind("plotselected", function (event, ranges) {
// do the zooming
- rf_this.selection_range.setFromFlotRanges(ranges);
- rf_this.selection_max=ranges.xaxis.to;
+ rf_this.selection_range.setFromFlotRanges(ranges);
graph = $.plot($(graph_jq_id), rf_this.selection_range.trim_flot_data(flot_data), graph_options);
// don't fire event on the scale to prevent eternal loop
|