X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fto_dom_coords.js;h=3def1effe89588a9e10db0240d5793e962ec3aab;hb=204161754f01aaf091f9fc7d5598ec5127a00f4f;hp=fb878ca9e2960cb9b14d0151a552ede587b4d096;hpb=efd5b117af64cfe0a47f48046a5001f63eb5ca44;p=dygraphs.git diff --git a/auto_tests/tests/to_dom_coords.js b/auto_tests/tests/to_dom_coords.js index fb878ca..3def1ef 100644 --- a/auto_tests/tests/to_dom_coords.js +++ b/auto_tests/tests/to_dom_coords.js @@ -130,14 +130,38 @@ ToDomCoordsTestCase.prototype.testYAxisLabelWidth = function() { valueRange: [0, 100], dateWindow: [0, 100], width: 500, - height: 500, + height: 500 } var graph = document.getElementById("graph"); g = new Dygraph(graph, [ [0,0], [100,100] ], opts); assertEquals([100, 0], g.toDomCoords(0, 100)); + assertEquals([500, 486], g.toDomCoords(100, 0)); g.updateOptions({ yAxisLabelWidth: 50 }); assertEquals([50, 0], g.toDomCoords(0, 100)); + assertEquals([500, 486], g.toDomCoords(100, 0)); +} + +ToDomCoordsTestCase.prototype.testAxisTickSize = function() { + var opts = { + yAxisLabelWidth: 100, + axisTickSize: 0, + rightGap: 0, + valueRange: [0, 100], + dateWindow: [0, 100], + width: 500, + height: 500 + } + + var graph = document.getElementById("graph"); + g = new Dygraph(graph, [ [0,0], [100,100] ], opts); + + assertEquals([100, 0], g.toDomCoords(0, 100)); + assertEquals([500, 486], g.toDomCoords(100, 0)); + + g.updateOptions({ axisTickSize : 50 }); + assertEquals([200, 0], g.toDomCoords(0, 100)); + assertEquals([500, 386], g.toDomCoords(100, 0)); }