["0","256","512","768","1k","1.25k","1.5k","1.75k","2k"],
Util.getYLabels());
};
+
+/**
+ * Verify that log scale axis range is properly specified.
+ */
+AxisLabelsTestCase.prototype.testLogScale = function() {
+ var g = new Dygraph("graph", [[0, 5], [1, 1000]], { logscale : true });
+ var nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; });
+ assertEquals(["6","10","30","60","100","300","600","1000"], nonEmptyLabels);
+
+ g.updateOptions({ logscale : false });
+ assertEquals(['0','200','400','600','800','1000'], Util.getYLabels());
+}
}
return a;
} ();
+var FIVE_TO_ONE_THOUSAND = [
+ [ 1, 10 ], [ 2, 20 ], [ 3, 30 ], [ 4, 40 ] , [ 5, 50 ],
+ [ 6, 60 ], [ 7, 70 ], [ 8, 80 ], [ 9, 90 ] , [ 10, 1000 ]];
var RangeTestCase = TestCase("range-tests");
assertEquals([0, 55], g.yAxisRange(0));
assertEquals([10, 20], g.xAxisRange());
}
+
+/**
+ * Verify that log scale axis range is properly specified.
+ */
+RangeTestCase.prototype.testLogScaleExcludesZero = function() {
+ var g = new Dygraph("graph", FIVE_TO_ONE_THOUSAND, { logscale : true });
+ assertEquals([10, 1099], g.yAxisRange(0));
+
+ g.updateOptions({ logscale : false });
+ assertEquals([0, 1099], g.yAxisRange(0));
+}