if (this.attr_("zoomCallback")) {
var minDate = this.rawData_[0][0];
var maxDate = this.rawData_[this.rawData_.length - 1][0];
- var minValue = this.xAxisRange()[0];
- var maxValue = this.xAxisRange()[1];
+ var minValue = this.yAxisRange()[0];
+ var maxValue = this.yAxisRange()[1];
this.attr_("zoomCallback")(minDate, maxDate, minValue, maxValue);
}
this.drawGraph_(this.rawData_);
<p><b>Zoom operations:</b></p>
<p>
- <input type="button" value="Zoom operation 1" onclick="sizeGraph(1)">
- <input type="button" value="Zoom operation 2" onclick="sizeGraph(2)">
- <input type="button" value="Zoom operation 3" onclick="sizeGraph(3)">
- <input type="button" value="Zoom operation 4" onclick="sizeGraph(4)">
- <input type="button" value="Unzoom" onclick="sizeGraph(5)">
+ <input type="button" value="Y (3,5)" onclick="sizeGraph(1)">
+ <input type="button" value="Y (0,4)" onclick="sizeGraph(2)">
+ <input type="button" value="Y (2,4)" onclick="sizeGraph(3)">
+ <input type="button" value="Y (0,2)" onclick="sizeGraph(4)">
+ <input type="button" value="Y (1,0)" onclick="sizeGraph(5)">
+ <input type="button" value="Unzoom" onclick="sizeGraph(0)">
</p>
function sizeGraph(i) {
switch(i) {
- case 1: g.doZoomYValues_(4, 2);
+ case 0: g.doUnzoom_();
+ break;
+ case 1: g.doZoomYValues_(5, 3);
+ break;
+ case 2: g.doZoomYValues_(4, 0);
+ break;
+ case 3: g.doZoomYValues_(4, 2);
+ break;
+ case 4: g.doZoomYValues_(2, 0);
+ break;
+ case 5: g.doZoomYValues_(1, 0);
break;
- case 5: g.doUnzoom_();
- break;
}
}
</script>