From c542cb6ac63665a415f517055a602bac85b791ea Mon Sep 17 00:00:00 2001 From: Wim Bruynooghe Date: Fri, 31 May 2013 13:27:11 +0200 Subject: [PATCH] Add test for custom bars with negative values in logScale --- auto_tests/tests/custom_bars.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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); +}; -- 2.7.4