X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fmissing_points.js;h=eb1c575f6fce677e0d791d4b03c54ca264a005e9;hb=4731ec3a0b60f81e8ef26fc95a69b9751069686b;hp=a78e0ac7f2ba20f379ceb03c5a38008fbae4ab8c;hpb=33b5c4b245bf29f3e908931bf70dde00b5fc8a51;p=dygraphs.git diff --git a/auto_tests/tests/missing_points.js b/auto_tests/tests/missing_points.js index a78e0ac..eb1c575 100644 --- a/auto_tests/tests/missing_points.js +++ b/auto_tests/tests/missing_points.js @@ -368,3 +368,36 @@ MissingPointsTestCase.prototype.testEmptySeries = function() { g.setSelection(6); assertEquals("1381134466: Series 2: 94", Util.getLegend(graphDiv)); }; + +// Regression test for issue #485 +MissingPointsTestCase.prototype.testMissingFill = function() { + var graphDiv = document.getElementById("graph"); + var N = null; + var g = new Dygraph( + graphDiv, + [ + [1, [8, 10, 12]], + [2, [3, 5,7] ], + [3, N, ], + [4, [9, N, 2] ], // Note: nulls in arrays are not technically valid. + [5, [N, 2, N] ], // see dygraphs.com/data.html. + [6, [2, 3, 6] ] + ], + { + customBars: true, + connectSeparatedPoints: false, + labels: [ "X", "Series1"] + } + ); + + // Make sure there are no 'NaN' line segments. + var htx = g.hidden_ctx_; + for (var i = 0; i < htx.calls__.length; i++) { + var call = htx.calls__[i]; + if ((call.name == 'moveTo' || call.name == 'lineTo') && call.args) { + for (var j = 0; j < call.args.length; j++) { + assertFalse(isNaN(call.args[j])); + } + } + } +};