X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fsimple_drawing.js;h=9eb23e6d64b4d66056c58479a7054bd2ff537348;hb=319d0361d2e512ed8049dfedffd79254e491201c;hp=27e9a1a1989fa7919fa12a641384ed43ab7999ad;hpb=24e420411024c92bc458d10db8aba29f8ca64b73;p=dygraphs.git diff --git a/auto_tests/tests/simple_drawing.js b/auto_tests/tests/simple_drawing.js index 27e9a1a..9eb23e6 100644 --- a/auto_tests/tests/simple_drawing.js +++ b/auto_tests/tests/simple_drawing.js @@ -27,24 +27,30 @@ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; var SimpleDrawingTestCase = TestCase("simple-drawing"); -SimpleDrawingTestCase._origFunc = Dygraph.getContext; +var _origFunc = Dygraph.getContext; SimpleDrawingTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(SimpleDrawingTestCase._origFunc(canvas)); + return new Proxy(_origFunc(canvas)); } }; SimpleDrawingTestCase.prototype.tearDown = function() { - Dygraph.getContext = SimpleDrawingTestCase._origFunc; + Dygraph.getContext = _origFunc; }; SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() { var opts = { - drawXGrid: false, - drawYGrid: false, - drawXAxis: false, - drawYAxis: false, + axes : { + x : { + drawGrid: false, + drawAxis: false, + }, + y : { + drawGrid: false, + drawAxis: false, + } + }, valueRange: [0,51] } var graph = document.getElementById("graph"); @@ -62,10 +68,16 @@ SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() { // See http://code.google.com/p/dygraphs/issues/detail?id=185 SimpleDrawingTestCase.prototype.testDrawSimpleRangeZeroToFifty = function() { var opts = { - drawXGrid: false, - drawYGrid: false, - drawXAxis: false, - drawYAxis: false, + axes : { + x : { + drawGrid: false, + drawAxis: false, + }, + y : { + drawGrid: false, + drawAxis: false, + } + }, valueRange: [0,50] } var graph = document.getElementById("graph"); @@ -96,12 +108,20 @@ SimpleDrawingTestCase.prototype.testDrawWithAxis = function() { */ SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() { var opts = { - drawXGrid: false, - drawYGrid: false, - drawXAxis: false, - drawYAxis: false, + axes: { + x: { + drawGrid: false, + drawAxis: false + }, + y: { + drawGrid: false, + drawAxis: false + } + }, + series: { 'Y1': {strokePattern: [25, 7, 7, 7]}, - colors: ['#ff0000'] + }, + colors: ['#ff0000'] }; var graph = document.getElementById("graph"); @@ -123,10 +143,16 @@ SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() { */ SimpleDrawingTestCase.prototype.testDrawThickLine = function() { var opts = { - drawXGrid: false, - drawYGrid: false, - drawXAxis: false, - drawYAxis: false, + axes : { + x : { + drawGrid: false, + drawAxis: false, + }, + y : { + drawGrid: false, + drawAxis: false, + } + }, strokeWidth: 15, colors: ['#ff0000'] };