Fix flaky testCustomBarsWithNegativeValuesInLogScale. DygraphLayout._calcYNormal...
[dygraphs.git] / dygraph-layout.js
index 56fdc3b..c1c2bc4 100644 (file)
@@ -213,7 +213,8 @@ DygraphLayout.prototype._evaluateLimits = function() {
 
 DygraphLayout._calcYNormal = function(axis, value, logscale) {
   if (logscale) {
-    return 1.0 - ((Dygraph.log10(value) - Dygraph.log10(axis.minyval)) * axis.ylogscale);
+    var x = 1.0 - ((Dygraph.log10(value) - Dygraph.log10(axis.minyval)) * axis.ylogscale);
+    return isFinite(x) ? x : NaN;
   } else {
     return 1.0 - ((value - axis.minyval) * axis.yscale);
   }