From: Dan Vanderkam Date: Sat, 19 Mar 2011 17:29:52 +0000 (-0400) Subject: fix gviz-numeric test X-Git-Tag: v1.0.0~556 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=92fd68d8d81bbe54bae58e4c02c9a2466cab966c;p=dygraphs.git fix gviz-numeric test --- diff --git a/dygraph.js b/dygraph.js index 64f4c18..26aff3a 100644 --- a/dygraph.js +++ b/dygraph.js @@ -3254,6 +3254,11 @@ Dygraph.prototype.parseDataTable_ = function(data) { annotations.push(ann); } } + + // Strip out infinities, which give dygraphs problems later on. + for (var j = 0; j < row.length; j++) { + if (!isFinite(row[j])) row[j] = null; + } } else { for (var j = 0; j < cols - 1; j++) { row.push([ data.getValue(i, 1 + 2 * j), data.getValue(i, 2 + 2 * j) ]); @@ -3262,11 +3267,6 @@ Dygraph.prototype.parseDataTable_ = function(data) { if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) { outOfOrder = true; } - - // Strip out infinities, which give dygraphs problems later on. - for (var j = 0; j < row.length; j++) { - if (!isFinite(row[j])) row[j] = null; - } ret.push(row); }