X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fcustom_bars.js;h=231dcd8e1bece1d1c756a210dc04cc2a9c81007e;hb=eec4fd0cb7dfc4dc661f00fca0c5ede94e8512a7;hp=2169ade3b8a11277ea4bc6dedbf30e1e7f557950;hpb=5d93f811018b7c7ef41cc0da7e1793ee228e0ed9;p=dygraphs.git diff --git a/auto_tests/tests/custom_bars.js b/auto_tests/tests/custom_bars.js index 2169ade..231dcd8 100644 --- a/auto_tests/tests/custom_bars.js +++ b/auto_tests/tests/custom_bars.js @@ -151,3 +151,33 @@ CustomBarsTestCase.prototype.testCustomBarsLogScale = function() { [247.5, 152.02209814465604]], { fillStyle: "#00ff00" }); }; + +CustomBarsTestCase.prototype.testCustomBarsWithNegativeValuesInLogScale = + function() { + var graph = document.getElementById("graph"); + + var count = 0; + var drawPointCallback = function() { + count++; + }; + + var g = new Dygraph(graph, + [ + [1, [10, 20,30]], + [2, [5, 10, 15]], + [3, [-1, 5, 10]] + ], + { + drawPoints: true, + drawPointCallback : drawPointCallback, + customBars: true + }); + + // Normally all three points would be drawn. + assertEquals(3, count); + count = 0; + + // In log scale, the third point shouldn't be shown. + g.updateOptions({ logscale : true }); + assertEquals(2, count); +};