X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Faxis_labels.js;h=ddb7a0f3a8e7818d9c5d8dbbed435e2056ec8d35;hb=fa0d7ad80802e2b31d9889936eb6ffd55dab1f43;hp=5c57fd6813ad29cbe167291dd61ab63cca9ec3f5;hpb=de624512adecc90456c0eba8969192876659c7cf;p=dygraphs.git diff --git a/auto_tests/tests/axis_labels.js b/auto_tests/tests/axis_labels.js index 5c57fd6..ddb7a0f 100644 --- a/auto_tests/tests/axis_labels.js +++ b/auto_tests/tests/axis_labels.js @@ -524,3 +524,26 @@ AxisLabelsTestCase.prototype.testLabelKMG2 = function() { ["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()); +} + +/** + * Verify that include zero range is properly specified. + */ +AxisLabelsTestCase.prototype.testIncludeZero = function() { + var g = new Dygraph("graph", [[0, 500], [1, 1000]], { includeZero : true }); + assertEquals(['0','200','400','600','800','1000'], Util.getYLabels()); + + g.updateOptions({ includeZero : false }); + assertEquals(['500','600','700','800','900','1000'], Util.getYLabels()); +}