[[-10, 10], [10, 10], [30, 1000]],
[-10, 30], [5.01691, 1993.25801]);
};
+
+/**
+ * Verify scrolling all-zero region, traditional.
+ */
+RangeTestCase.prototype.testZeroScroll = function() {
+ g = new Dygraph(
+ document.getElementById("graph"),
+ "X,Y\n" +
+ "1,0\n" +
+ "8,0\n" +
+ "9,0.1\n",
+ {
+ drawAxesAtZero: true,
+ animatedZooms: true,
+ avoidMinZero: true
+ });
+};
+
+/**
+ * Verify scrolling all-zero region, new-style.
+ */
+RangeTestCase.prototype.testZeroScroll2 = function() {
+ g = new Dygraph(
+ document.getElementById("graph"),
+ "X,Y\n" +
+ "1,0\n" +
+ "8,0\n" +
+ "9,0.1\n",
+ {
+ animatedZooms: true,
+ drawAxesAtZero: true,
+ xRangePad: 4,
+ yRangePad: 4
+ });
+};
*/
Dygraph.prototype.xAxisExtremes = function() {
var pad = this.attr_('xRangePad') / this.plotter_.area.w;
- if (!this.numRows() > 0) {
+ if (this.numRows() == 0) {
return [0 - pad, 1 + pad];
}
var left = this.rawData_[0][0];
};
/**
- * Returns the full range of the x-axis, as determined by the most extreme
- * values in the data set. Not affected by zooming, visibility, etc.
- * TODO(danvk): merge w/ xAxisExtremes
- * @return { Array<Number> } A [low, high] pair
- * @private
- */
-Dygraph.prototype.fullXRange_ = function() {
- return this.xAxisExtremes();
-};
-
-/**
* Returns the value in the given row and column. If the row and column exceed
* the bounds on the data, returns null. Also returns null if the value is
* missing.
if (this.dateWindow_) {
range = [this.dateWindow_[0], this.dateWindow_[1]];
} else {
- range = this.fullXRange_();
+ range = this.xAxisExtremes();
}
var xAxisOptionsView = this.optionsViewForAxis_('x');