X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=26aff3a19d83f0007f38e2efb6503a8e57b64f92;hb=606568fef36a321148399da4c58a05e2753ac2f9;hp=64f4c18d2ef063559446e92ca509caa882295526;hpb=1eb2feb3ea1d2e6d87e15529b66283474f1458d8;p=dygraphs.git 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); }