X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fmultiple_axes.js;h=d08ff50ce9d13196b17e467e7c59a0a541caf2fd;hb=45a8c16f0f004c4513d2127553d1a2cb2502f282;hp=05e93c75526ad186814de9fadaa72072df27c66f;hpb=5b6d85fdd7b79dc62886a67a08fb9019c98f796c;p=dygraphs.git diff --git a/auto_tests/tests/multiple_axes.js b/auto_tests/tests/multiple_axes.js index 05e93c7..d08ff50 100644 --- a/auto_tests/tests/multiple_axes.js +++ b/auto_tests/tests/multiple_axes.js @@ -290,4 +290,47 @@ MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { ); assertEquals(["40", "45", "50", "55", "60", "65", "70", "75"], getYLabelsForAxis("1")); assertEquals(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], getYLabelsForAxis("2")); -}; \ No newline at end of file +}; + +MultipleAxesTestCase.prototype.testDrawPointCallback = function() { + var data = MultipleAxesTestCase.getData(); + + var results = { y : {}, y2 : {}}; + var firstCallback = function(g, seriesName, ctx, canvasx, canvasy, color, radius) { + results.y[seriesName] = 1; + Dygraph.Circles.DEFAULT(g, seriesName, ctx, canvasx, canvasy, color, radius); + + }; + var secondCallback = function(g, seriesName, ctx, canvasx, canvasy, color, radius) { + results.y2[seriesName] = 1; + Dygraph.Circles.TRIANGLE(g, seriesName, ctx, canvasx, canvasy, color, radius); + }; + + g = new Dygraph( + document.getElementById("graph"), + data, + { + labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ], + drawPoints : true, + pointSize : 3, + 'Y3': { + axis: { + } + }, + 'Y4': { + axis: 'Y3' // use the same y-axis as series Y3 + }, + axes: { + y2: { + drawPointCallback: secondCallback + } + }, + drawPointCallback: firstCallback + } + ); + + assertEquals(1, results.y["Y1"]); + assertEquals(1, results.y["Y2"]); + assertEquals(1, results.y2["Y3"]); + assertEquals(1, results.y2["Y4"]); +};